本文整理汇总了C#中System.Windows.Controls.Canvas.ToWindow方法的典型用法代码示例。如果您正苦于以下问题:C# Canvas.ToWindow方法的具体用法?C# Canvas.ToWindow怎么用?C# Canvas.ToWindow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Controls.Canvas
的用法示例。
在下文中一共展示了Canvas.ToWindow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
public static void Main(string[] args)
{
var c = new Canvas();
var w = c.ToWindow();
w.WithGlass();
w.ShowDialog();
}
示例2: Main
static void Main(string[] args)
{
var c = new JSCSolutionsNETCarouselCanvas
{
CloseOnClick = false
};
c.HideSattelites();
//c.Container.Effect = new DropShadowEffect();
//c.Container.BitmapEffect = new DropShadowBitmapEffect();
//.MoveTo(0, ImageCarouselCanvas.DefaultHeight - 96).SizeTo(ImageCarouselCanvas.DefaultWidth, 96);
var cc = new Canvas();
// http://cloudstore.blogspot.com/2008/05/creating-custom-window-style.html
var wcam = new Window();
wcam.Background = Brushes.Transparent;
wcam.WindowStyle = WindowStyle.None;
wcam.ResizeMode = ResizeMode.NoResize;
wcam.SizeTo(200, 200);
wcam.AllowsTransparency = true;
//wcam.Opacity = 0.5;
wcam.ShowInTaskbar = false;
wcam.Cursor = Cursors.Hand;
wcam.Focusable = false;
wcam.Topmost = true;
var w = cc.ToWindow();
w.SizeToContent = SizeToContent.Manual;
//w.SizeTo(400, 400);
//w.ToTransparentWindow();
// http://blog.joachim.at/?p=39
// http://blogs.msdn.com/changov/archive/2009/01/19/webbrowser-control-on-transparent-wpf-window.aspx
// http://blogs.interknowlogy.com/johnbowen/archive/2007/06/20/20458.aspx
w.AllowsTransparency = true;
w.WindowStyle = System.Windows.WindowStyle.None;
w.Focusable = false;
//w.Background = new SolidColorBrush(Color.FromArgb(0x20, 0, 0, 0));
w.Background = Brushes.Transparent;
w.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
w.Topmost = true;
//w.ShowInTaskbar = false;
var winfoc = new Canvas();
var winfo = winfoc.ToWindow();
winfo.AllowsTransparency = true;
winfo.ShowInTaskbar = false;
winfo.WindowStyle = WindowStyle.None;
//winfo.Background = Brushes.Transparent;
winfo.Background = Brushes.Red;
winfo.Opacity = 0.3;
winfo.ResizeMode = ResizeMode.NoResize;
winfo.SizeToContent = SizeToContent.Manual;
winfo.Topmost = true;
// http://www.squidoo.com/youtubehd
var NextInputModeEnabled = false;
var NextInputModeKeyDownEnabled = false;
Action<Key> NextInputModeKeyDown = delegate { };
var CommandKeysEnabled = false;
#region TopicText
var TopicText = new System.Windows.Controls.TextBox
{
//IsReadOnly = true,
Background = Brushes.Transparent,
BorderThickness = new System.Windows.Thickness(0),
Foreground = Brushes.White,
Effect = new DropShadowEffect(),
Text = "JSC C# Foo Bar",
//TextDecorations = TextDecorations.Underline,
FontFamily = new FontFamily("Verdana"),
FontSize = 24,
TextAlignment = System.Windows.TextAlignment.Right
};
//.........这里部分代码省略.........