本文整理汇总了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?
}