當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。