当前位置: 首页>>代码示例>>C#>>正文


C# TrackBar.AttachTo方法代码示例

本文整理汇总了C#中System.Windows.Forms.TrackBar.AttachTo方法的典型用法代码示例。如果您正苦于以下问题:C# TrackBar.AttachTo方法的具体用法?C# TrackBar.AttachTo怎么用?C# TrackBar.AttachTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.TrackBar的用法示例。


在下文中一共展示了TrackBar.AttachTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Application


//.........这里部分代码省略.........
			var css = Native.css[typeof(Form)][" .caption"];
			//var css = IStyleSheet.all[" .caption"];


			//new IHTMLPre { new { css.rule.selectorText } }.AttachToDocument();


			// https://code.google.com/p/chromium/issues/detail?id=229330
			(css.style as dynamic).webkitAppRegion = "drag";

			//(ff.CaptionForeground.style as dynamic).webkitAppRegion = "drag";

			FormStyler.AtFormCreated = FormStylerLikeFloat.LikeFloat;

			var ShadowRightBottom = 8;

			var f = new Form
			{

				ShowIcon = false,

				Text = Native.document.title,

				//Text = Native.document.location.hash,
				StartPosition = FormStartPosition.Manual
			};


			f.MoveTo(0, 0).SizeTo(
					Native.window.Width - ShadowRightBottom,
					Native.window.Height - ShadowRightBottom
				);

			//f.Opacity = 0.5;

			f.Show();


			var t = new TrackBar
			{

				Maximum = 100,
				Minimum = 40,

				Dock = DockStyle.Top
			};
			t.AttachTo(f);
			t.ValueChanged += delegate
			{
				f.Opacity = (double)t.Value / (double)t.Maximum;

			};
			f.Opacity = 0.8;

			var w = new WebBrowser
			{

				// this wont work?
				//Dock = DockStyle.Fill

			}.AttachTo(f);

			w.Navigate(
				Native.document.title
			);



			f.FormClosed +=
				delegate
			{
				// close the appwindow

				// DWM animates the close.
				Native.window.close();
			};

			f.SizeChanged +=
				delegate
			{
				Native.window.resizeTo(
					f.Width + ShadowRightBottom,
					f.Height + ShadowRightBottom
				);

			};

			Native.window.onresize +=
				delegate
			{
				// outer frame is resized
				f.SizeTo(
					Native.window.Width - ShadowRightBottom,
					Native.window.Height - ShadowRightBottom
				);

			};

			// activate resize grip to window width?
		}
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:101,代码来源:Application.cs


注:本文中的System.Windows.Forms.TrackBar.AttachTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。