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


C# Window.Show方法代码示例

本文整理汇总了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();
                }
            }
        }
开发者ID:CarlSosaDev,项目名称:Avalonia,代码行数:32,代码来源:DevTools.xaml.cs

示例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();
	
     }
开发者ID:emtees,项目名称:old-code,代码行数:30,代码来源:ewl_sharp_test.cs

示例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();
    }
开发者ID:xxjeng,项目名称:nuxleus,代码行数:27,代码来源:EmbedFinal.cs

示例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();
            }
开发者ID:Pokat,项目名称:Life,代码行数:35,代码来源:Class1.cs

示例5: Main

    public static void Main()
    {
        Application.Init();
        Window window = new Window("Hello World!");
        window.Show();

        Application.Run();
    }
开发者ID:renra,项目名称:CSharp-tutorial,代码行数:8,代码来源:gtk.cs

示例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 ();
 }
开发者ID:BackupTheBerlios,项目名称:simetron,代码行数:9,代码来源:Parent.cs

示例7: Main

    static void Main()
    {
        Application.Init ();

                Window window = new Window ("Hello MTE");
                window.Show();

                Application.Run ();
    }
开发者ID:bakcyl8bit,项目名称:SimpleWS,代码行数:9,代码来源:hellogtk.cs

示例8: Main

    static void Main()
    {
        Application.Init ();

        Window window = new Window ("helloworld");
        window.Show();

        Application.Run ();
    }
开发者ID:msphair,项目名称:MonoTesting,代码行数:9,代码来源:hello-gtk.cs

示例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;
    }
开发者ID:kanukanun,项目名称:MakeGableRoofVolumes,代码行数:52,代码来源:Rhino_Processing.cs

示例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");
    }
开发者ID:nulltoken,项目名称:PlatformInstaller,代码行数:13,代码来源:ScreenCapture.cs

示例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 ();
    }
开发者ID:Harvie,项目名称:Programs,代码行数:14,代码来源:hello.cs

示例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 ();
	}
开发者ID:liberostelios,项目名称:gtk-sharp,代码行数:14,代码来源:MountOperation.cs

示例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;
		}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:14,代码来源:Utility.cs

示例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();
        }
开发者ID:Wiladams,项目名称:NewTOAPIA,代码行数:20,代码来源:Program.cs

示例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();
            }
        }
开发者ID:Scellow,项目名称:Perspex,代码行数:17,代码来源:DevTools.cs


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