本文整理汇总了C#中Window.Show方法的典型用法代码示例。如果您正苦于以下问题:C# Window.Show方法的具体用法?C# Window.Show怎么用?C# Window.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Window
的用法示例。
在下文中一共展示了Window.Show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WindowPreviewKeyDown
private static void WindowPreviewKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.F12)
{
var window = (Window)sender;
var devToolsWindow = default(Window);
if (s_open.TryGetValue(window, out devToolsWindow))
{
devToolsWindow.Activate();
}
else
{
var devTools = new DevTools(window);
devToolsWindow = new Window
{
Width = 1024,
Height = 512,
Content = devTools,
DataTemplates = new DataTemplates
{
new ViewLocator<ReactiveObject>(),
}
};
devToolsWindow.Closed += devTools.DevToolsClosed;
s_open.Add((Window)sender, devToolsWindow);
devToolsWindow.Show();
}
}
}
示例2: HelloWorld
public HelloWorld()
{
win = new Window();
win.Title = "Hello World";
win.Name = "EWL_WINDOW";
win.Class = "EWLWindow";
win.SizeRequest(200, 100);
win.DeleteEvent += winDelete;
win.Show();
lbl = new Entry();
//lbl.SetFont("/usr/share/fonts/ttf/western/Adeventure.ttf", 12);
//lbl.SetColor(255, 0 , 0 , 255);
//lbl.Style = "soft_shadow";
//lbl.SizeRequest(win.Width, win.Height);
//lbl.Disable();
lbl.ChangedEvent += new EwlEventHandler(txtChanged);
lbl.Text = "Enlightenment";
Console.WriteLine(lbl.Text);
Console.WriteLine(lbl.Text);
lbl.TabOrderPush();
win.Append(lbl);
lbl.Show();
}
示例3: CreateAndShowMainWindow
private void CreateAndShowMainWindow() {
// Create the application's main window
mainWindow = new Window();
// Create a canvas sized to fill the window
canvas = new Canvas();
canvas.Background = Brushes.LightSteelBlue;
// Add a "Hello World!" text element to the Canvas
TextBlock txt = new TextBlock();
txt.FontSize = 30;
txt.TextContent = "Hello World!";
Canvas.SetTop(txt, 100);
Canvas.SetLeft(txt, 100);
canvas.Children.Add(txt);
Button btn = new Button();
btn.FontSize = 30;
btn.Content = "Run Script";
btn.Click += new RoutedEventHandler(btn_Click);
Canvas.SetTop(btn, 20);
Canvas.SetLeft(btn, 100);
canvas.Children.Add(btn);
mainWindow.Content = canvas;
mainWindow.Show();
}
示例4: Main
static void Main(string[] args)
{
i = new Image();
RenderOptions.SetBitmapScalingMode(i, BitmapScalingMode.NearestNeighbor);
RenderOptions.SetEdgeMode(i, EdgeMode.Aliased);
w = new Window();
w.Content = i;
w.Show();
writeableBitmap = new WriteableBitmap(
(int)w.ActualWidth,
(int)w.ActualHeight,
96,
96,
PixelFormats.Bgr32,
null);
i.Source = writeableBitmap;
i.Stretch = Stretch.None;
i.HorizontalAlignment = HorizontalAlignment.Left;
i.VerticalAlignment = VerticalAlignment.Top;
i.MouseMove += new MouseEventHandler(i_MouseMove);
i.MouseLeftButtonDown +=
new MouseButtonEventHandler(i_MouseLeftButtonDown);
i.MouseRightButtonDown +=
new MouseButtonEventHandler(i_MouseRightButtonDown);
w.MouseWheel += new MouseWheelEventHandler(w_MouseWheel);
Application app = new Application();
app.Run();
}
示例5: Main
public static void Main()
{
Application.Init();
Window window = new Window("Hello World!");
window.Show();
Application.Run();
}
示例6: Main
public static void Main()
{
Application.Init ();
Window w = new Window ("Hi");
w.DeleteEvent += new DeleteEventHandler (OnDeleteEvent);
w.Show ();
Widget widget = w.Parent;
Application.Run ();
}
示例7: Main
static void Main()
{
Application.Init ();
Window window = new Window ("Hello MTE");
window.Show();
Application.Run ();
}
示例8: Main
static void Main()
{
Application.Init ();
Window window = new Window ("helloworld");
window.Show();
Application.Run ();
}
示例9: Run
public void Run(RhinoDoc _doc, bool refresh = true)
{
doc = _doc;
//Rhino.Display.DisplayPipeline.DrawForeground +=
// make dialog to stop iteration
window = new Window
{
Title = "stop loop",
Width = 100,
Height = 50
};
StackPanel stack_panel = new StackPanel();
Button stop_button = new Button();
stop_button.Content = "stop";
stop_button.Click += Abort;
stack_panel.Children.Add(stop_button);
window.Content = stack_panel;
new System.Windows.Interop.WindowInteropHelper(window).Owner = Rhino.RhinoApp.MainWindowHandle();
window.Show();
// iteration starts here
DateTime time_start = DateTime.Now;
Setup(); // frame_no
while (is_Running)
{
if (refresh) Refresh();
frame_no++;
Draw();
doc.Views.Redraw();
RhinoApp.Wait();
}
Finish();
TimeSpan duration = DateTime.Now - time_start;
double frames_per_second = Math.Truncate(frame_no / duration.TotalSeconds * 100.0) / 100.0;
RhinoApp.WriteLine("fps: " + frames_per_second);
frame_no = 0;
}
示例10: TakeScreenShot
public static void TakeScreenShot(Screen model, UserControl view )
{
var window = new Window
{
Content = view,
Height = 550,
Width = 450
};
ViewModelBinder.Bind(model, window, null);
window.Show();
WpfUtils.ScreenCapture(window, model.GetType().Name.Replace("ViewModel","") + ".png");
}
示例11: Main
static void Main()
{
Application.Init ();
GTKBuilder builder = new GtkBuilder();
builder->add_from_file("hello.ui");
builder->connect_signals();
Window window = new Window ("helloworld");
window.Show();
Application.Run ();
}
示例12: Main
static void Main ()
{
Gtk.Application.Init ();
file = FileFactory.NewForUri (new Uri ("smb://[email protected]/myshare/test"));
Window w = new Window ("test");
operation = new Gtk.MountOperation (w);
Button b = new Button ("Mount");
b.Clicked += new System.EventHandler (HandleButtonClicked);
b.Show ();
w.Add (b);
w.Show ();
Gtk.Application.Run ();
}
示例13: GetEmptyButtonSize
public static double GetEmptyButtonSize ()
{
if (empty_button_size == -1) {
Window window = new Window ();
Canvas canvas = new Canvas ();
window.Content = canvas;
Button button = new Button ();
canvas.Children.Add (button);
window.Show ();
empty_button_size = button.DesiredSize.Width;
window.Close ();
}
return empty_button_size;
}
示例14: Main
/// <summary>
/// The main entry point for the application.
/// </summary>
//[STAThread]
static void Main()
{
// Create the window that we'll show on the screen
Window win = new Window("Hello NewTOAPIA", 10, 10, 320, 240);
// Explicitly call show as the window is not shown by default
win.BackgroundColor = Colorrefs.White;
win.Show();
// Draw into the window directly
win.ClientAreaGraphPort.DrawString(100, 100, "Hello NewTOAPIA!");
// Start the window/application running. It will continue
// running until the close box is clicked on.
win.Run();
}
示例15: WindowPreviewKeyDown
private static void WindowPreviewKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.F12)
{
Window window = new Window
{
Width = 1024,
Height = 512,
Content = new DevTools
{
Root = (Window)sender,
},
};
window.Show();
}
}