• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Forms.Form类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Forms.Form的典型用法代码示例。如果您正苦于以下问题:C# System.Windows.Forms.Form类的具体用法?C# System.Windows.Forms.Form怎么用?C# System.Windows.Forms.Form使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



System.Windows.Forms.Form类属于命名空间,在下文中一共展示了System.Windows.Forms.Form类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Game1

        public Game1(IntPtr drawSurface,
                    System.Windows.Forms.Form parentForm,
                    System.Windows.Forms.PictureBox surfacePictureBox)
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            this.drawSurface = drawSurface;
            this.parentForm = parentForm;
            this.pictureBox = surfacePictureBox;

            graphics.PreparingDeviceSettings +=
                new EventHandler<PreparingDeviceSettingsEventArgs>(
                graphics_PreparingDeviceSettings);

            Mouse.WindowHandle = drawSurface;

            gameForm =
                System.Windows.Forms.Control.FromHandle(this.Window.Handle);
            gameForm.VisibleChanged += new EventHandler(gameForm_VisibleChanged);
            pictureBox.SizeChanged += new EventHandler(pictureBox_SizeChanged);

            vscroll =
                (System.Windows.Forms.VScrollBar)parentForm.Controls["vScrollBar1"];
            hscroll =
                (System.Windows.Forms.HScrollBar)parentForm.Controls["hScrollBar1"];

        }
开发者ID:RaulPB,项目名称:videogames,代码行数:28,代码来源:Game1.cs


示例2: CloseForm

 protected override void CloseForm()
 {
     if (_form == null) return;
     _form.Close();
     _form.Dispose();
     _form = null;
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:7,代码来源:TestReadOnlyGridControlWin.cs


示例3: CreateSelector

 protected override IBOColSelectorControl CreateSelector()
 {
     IEditableGridControl readOnlyGridControl = GetControlFactory().CreateEditableGridControl();
     System.Windows.Forms.Form frm = new System.Windows.Forms.Form();
     frm.Controls.Add((System.Windows.Forms.Control)readOnlyGridControl);
     return GetControlledLifetimeFor(readOnlyGridControl);
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:7,代码来源:TestBOSelectorEditableGridControlWin.cs


示例4: CreateGridBaseStub

 protected override IGridBase CreateGridBaseStub()
 {
     GridBaseWinStub gridBase = new GridBaseWinStub();
     System.Windows.Forms.Form frm = new System.Windows.Forms.Form();
     frm.Controls.Add(gridBase);
     return GetControlledLifetimeFor(gridBase);
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:7,代码来源:TestGridBaseWin.cs


示例5: GetGraph

        public void GetGraph(Stream outputstream, DateTime from)
        {
            ObjectCache cache = MemoryCache.Default;
            Bitmap bm = cache["graph"] as Bitmap;

            if (bm == null)
            {
                bm = DrawGraph(from);
            }

            if (!System.Diagnostics.Debugger.IsAttached)
                bm.Save(outputstream, System.Drawing.Imaging.ImageFormat.Jpeg);
            else
            {
                System.Windows.Forms.Form f = new System.Windows.Forms.Form();
                f.Height = 610;
                f.Width = 810;
                System.Windows.Forms.PictureBox pb = new System.Windows.Forms.PictureBox();
                pb.Top = 1;
                pb.Left = 1;
                pb.Width = 800;
                pb.Height = 600;
                pb.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
                pb.Visible = true;
                f.Controls.Add(pb);

                pb.Image = bm;

                System.Windows.Forms.Application.Run(f);
            }
        }
开发者ID:RoyChase,项目名称:CSTherm,代码行数:31,代码来源:Chart.cs


示例6: GetInterface

 private void GetInterface()
 {
     int hr;
     System.Windows.Forms.Form f = new System.Windows.Forms.Form();
     hr = MFExtern.MFCreateVideoRendererActivate(IntPtr.Zero, out m_a);
     MFError.ThrowExceptionForHR(hr);
 }
开发者ID:GoshaDE,项目名称:SuperMFLib,代码行数:7,代码来源:IMFActivateTest.cs


示例7: Run

        public void Run()
        {
            // 初期設定を行う。
            var option = new asd.EngineOption
            {
                IsFullScreen = false
            };

            bool closed = false;
            System.Windows.Forms.Form form = new System.Windows.Forms.Form();
            form.FormClosed += (object sender, System.Windows.Forms.FormClosedEventArgs e) =>
                {
                    closed = true;
                };
            form.Show();

            // aceを初期化する。
            asd.Engine.InitializeByExternalWindow(form.Handle, IntPtr.Zero, form.Size.Width, form.Size.Height, option);

            // aceが進行可能かチェックする。
            while (asd.Engine.DoEvents())
            {
                System.Windows.Forms.Application.DoEvents();
                if (closed) break;

                // aceを更新する。
                asd.Engine.Update();
            }

            // aceを終了する。
            asd.Engine.Terminate();
        }
开发者ID:Pctg-x8,项目名称:Altseed,代码行数:32,代码来源:EmptyExternal.cs


示例8: DoSomething

 /// <summary>
 /// Just uses a messagebox to show the external request.
 /// </summary>
 /// <param name="someParameter"></param>
 /// <returns></returns>
 public bool DoSomething(string someParameter)
 {
     if (mMainWindow == null)
     {
         mMainWindow = System.Windows.Forms.Control.FromHandle(System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle) as System.Windows.Forms.Form;
     }
     // Just a few manipulations of the main window
     if (mMainWindow != null)
     {
         someParameter = someParameter.ToLowerInvariant();
         switch(someParameter)
         {
             case "hide":
                 mMainWindow.Hide();
                 break;
             case "show":
                 mMainWindow.Show();
                 break;
             case "min":
                 mMainWindow.WindowState = System.Windows.Forms.FormWindowState.Minimized;
                 break;
             case "max":
                 mMainWindow.WindowState = System.Windows.Forms.FormWindowState.Maximized;
                 break;
         }
     }
     else
     {
         System.Windows.Forms.MessageBox.Show("Could not get main window");
     }
     return System.Windows.Forms.MessageBox.Show(String.Format("Plugin does something on remote request: {0}\nSucceeded?", someParameter),
                "Remote request to plugin",
                System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes;
 }
开发者ID:PatrickKursawe,项目名称:ChronosMockPlugin,代码行数:39,代码来源:RemoteServiceImplementation.cs


示例9: openShortnDialog

        /// <summary>
        /// Open the Shortn dialog window.  Used internally after the Shortn button is pressed, and by Ribbon for the debugging
        /// </summary>
        /// <param name="data"></param>
        public static void openShortnDialog(ShortnData data)
        {
            System.Windows.Forms.Form newForm = new System.Windows.Forms.Form();
            newForm.Width = 1200;
            newForm.Height = int.MaxValue;
            newForm.BackColor = System.Drawing.Color.White;

            // Create the ElementHost control for hosting the
            // WPF UserControl.
            ElementHost host = new ElementHost();
            host.Dock = System.Windows.Forms.DockStyle.Fill;

            // Create the WPF UserControl.
            ShortnDialog sd = new ShortnDialog(data);

            // Assign the WPF UserControl to the ElementHost control's
            // Child property.
            host.Child = sd;

            newForm.Visible = false;
            // Add the ElementHost control to the form's
            // collection of child controls.
            newForm.Controls.Add(host);
            newForm.Show();

            // set the form's height based on what the textbox wants to be
            int dialogHeight = (int)sd.grid.DesiredSize.Height;
            newForm.Height = (int)(sd.DesiredSize.Height + newForm.Padding.Vertical + System.Windows.Forms.SystemInformation.CaptionHeight + System.Windows.SystemParameters.ScrollWidth);
            sd.grid.Height = sd.grid.DesiredSize.Height;
            newForm.Width = 1200;
            host.MaximumSize = new System.Drawing.Size(1200, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height);
            newForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;

            newForm.Visible = true;
        }
开发者ID:tummykung,项目名称:soylent,代码行数:39,代码来源:ShortnView.cs


示例10: Main

        static void Main(string[] args)
        {
            #if DEBUG
            Microsoft.Msagl.GraphViewerGdi.DisplayGeometryGraph.SetShowFunctions();
            #endif
            //create a form
            System.Windows.Forms.Form form = new System.Windows.Forms.Form();
            //create a viewer object
            Microsoft.Msagl.GraphViewerGdi.GViewer viewer = new Microsoft.Msagl.GraphViewerGdi.GViewer();

            //associate the viewer with the form
            form.SuspendLayout();
            viewer.Dock = System.Windows.Forms.DockStyle.Fill;
            form.Controls.Add(viewer);
            form.ResumeLayout();
                    //create a graph object
            #if GraphModel

            Graph graph = DgmlParser.DgmlParser.Parse("fullstring.dgml");

            SugiyamaLayoutSettings ss = graph.LayoutAlgorithmSettings as SugiyamaLayoutSettings;

            // uncomment this line to see the wide graph
            // ss.MaxAspectRatioEccentricity = 100;

            // uncommment this line to us Mds
            // ss.FallbackLayoutSettings = new MdsLayoutSettings {AdjustScale = true};

            // or uncomment the following line to use the default layering layout with vertical layer
            // graph.Attr.LayerDirection = LayerDirection.LR;

            viewer.Graph = graph;
            form.ShowDialog();
            #endif
        }
开发者ID:mrkcass,项目名称:SuffixTreeExplorer,代码行数:35,代码来源:Program.cs


示例11: CapturedItemsListController

        private CapturedItemsListController(MainWindow mainWindow)
        {
            this.mainWindow = mainWindow;
            this.mainWindowPtr = new System.Windows.Interop.WindowInteropHelper(mainWindow).Handle;

            f = new System.Windows.Forms.Form();
            sh = new ShellHook(f.Handle);
            sh.WindowActivated += sh_WindowActivated;
            sh.RudeAppActivated += sh_WindowActivated;
            ch = new ClipboardHelper(f.Handle);
            ch.ClipboardGrabbed += ch_ClipboardGrabbed;
            ch.RegisterClipboardListener();

            gh = new GlobalHotkeyHelper(f.Handle);
            gh.GlobalHotkeyFired += new GlobalHotkeyHandler(gh_GlobalHotkeyFired);

            gh.RegisterHotKey(666, KeyModifiers.Alt | KeyModifiers.Control | KeyModifiers.Shift, VirtualKeys.VK_Z);
            gh.RegisterHotKey(667, KeyModifiers.Alt | KeyModifiers.Control | KeyModifiers.Shift, VirtualKeys.VK_1);
            gh.RegisterHotKey(668, KeyModifiers.Alt | KeyModifiers.Control | KeyModifiers.Shift, VirtualKeys.VK_2);
            gh.RegisterHotKey(669, KeyModifiers.Alt | KeyModifiers.Control | KeyModifiers.Shift, VirtualKeys.VK_3);
            gh.RegisterHotKey(670, KeyModifiers.Alt | KeyModifiers.Control | KeyModifiers.Shift, VirtualKeys.VK_4);
            gh.RegisterHotKey(671, KeyModifiers.Alt | KeyModifiers.Control | KeyModifiers.Shift, VirtualKeys.VK_5);
            gh.RegisterHotKey(672, KeyModifiers.Alt | KeyModifiers.Control | KeyModifiers.Shift, VirtualKeys.VK_6);
            gh.RegisterHotKey(673, KeyModifiers.Alt | KeyModifiers.Control | KeyModifiers.Shift, VirtualKeys.VK_7);
            gh.RegisterHotKey(674, KeyModifiers.Alt | KeyModifiers.Control | KeyModifiers.Shift, VirtualKeys.VK_8);
            gh.RegisterHotKey(675, KeyModifiers.Alt | KeyModifiers.Control | KeyModifiers.Shift, VirtualKeys.VK_9);
            gh.RegisterHotKey(676, KeyModifiers.Alt | KeyModifiers.Control | KeyModifiers.Shift, VirtualKeys.VK_0);
        }
开发者ID:deadtrickster,项目名称:wpfklip,代码行数:28,代码来源:CapturedItemsListController.cs


示例12: HandlePluginLaunch

        private void HandlePluginLaunch(object sender, EventArgs e)
        {
            //NWN2Toolset.NWN2.Data.Blueprints.NWN2GlobalBlueprintManager bpManager = new NWN2Toolset.NWN2.Data.Blueprints.NWN2GlobalBlueprintManager();
            //bpManager.Initialize();
            NWN2Toolset.NWN2.Data.TypedCollections.NWN2BlueprintCollection items = NWN2Toolset.NWN2.Data.Blueprints.NWN2GlobalBlueprintManager.GetBlueprintsOfType(NWN2Toolset.NWN2.Data.Templates.NWN2ObjectType.Item);
            ALFAItemBlueprint scroll;
            
            System.Windows.Forms.Form form = new System.Windows.Forms.Form();
            /*System.Windows.Forms.TextBox text = new System.Windows.Forms.TextBox();
            text.Size = new System.Drawing.Size(400, 300);
            text.Multiline = true;
            text.WordWrap = false;
            text.AcceptsReturn = true;
            text.AcceptsTab = true;
            text.ScrollBars = System.Windows.Forms.ScrollBars.Both;
            text.Text = scroll.ToString();*/
            System.Windows.Forms.ListBox listBox = new System.Windows.Forms.ListBox();
            listBox.Sorted = true;
            listBox.HorizontalScrollbar = true;
            listBox.Size = new System.Drawing.Size(400, 300);

            form.Controls.Add(listBox);
            form.Size = new System.Drawing.Size(430, 330);
            form.Show();    

            //items.Add(scroll.ItemBlueprint);
            //scroll.TemplateResRef = "TEST RESREF";
            //scroll.AddItemProperty(ALFAItemProperty.CastSpell1ChargeItemProperty(0));
            //scroll.AddItemProperty(ALFAItemProperty.WizardOnlyItemProperty());            
            //items.Add(scroll.ItemBlueprint);

            ConsumableCreator cc = new ConsumableCreator();
            cc.Run();
        }
开发者ID:CastanoALFA,项目名称:ALFA-Base-Resources,代码行数:34,代码来源:ABR_Creator.cs


示例13: CreateSelector

 protected override IBOColSelectorControl CreateSelector()
 {
     MultiSelectorWin<MyBO> multiSelectorWin = new MultiSelectorWin<MyBO>(GetControlFactory());
     System.Windows.Forms.Form frm = new System.Windows.Forms.Form();
     frm.Controls.Add(multiSelectorWin);
     return multiSelectorWin;
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:7,代码来源:TestBOColMultiselector.cs


示例14: CreateSelector

 protected override IBOColSelectorControl CreateSelector()
 {
     GridBaseWinStub gridBase = new GridBaseWinStub();
     System.Windows.Forms.Form frm = new System.Windows.Forms.Form();
     frm.Controls.Add(gridBase);
     SetupGridColumnsForMyBo(gridBase);
     return GetControlledLifetimeFor(gridBase);
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:8,代码来源:TestBOSelectorGridWin.cs


示例15: Input

        public Input(System.Windows.Forms.Form form1_reference, IntPtr window_handle)
        {
            _form1_reference = form1_reference;
            critical_failure = false;

            populate_key_list();
            Initialize_Keyboard(window_handle);
        }
开发者ID:hatori,项目名称:Space-Invaders-Revolution,代码行数:8,代码来源:Input.cs


示例16: SetAlphaBlending

 public void SetAlphaBlending(System.Windows.Forms.Form form)
 {
     this.form = form;
     this.form.Opacity = 0.0;
     this.form.Activate();
     this.form.Refresh();
     fadeTimer.Start();
 }
开发者ID:wgang10,项目名称:XTHospatal,代码行数:8,代码来源:AlphaBlendingBringer.cs


示例17: Window

 public Window()
 {
     nativeBinding = new System.Windows.Forms.Form();
     onShown += new DWMEventArgs(Window_onShown);
     onHide += new DWMEventArgs(Window_onHide);
     onFocus += new DWMEventArgs(Window_onFocus);
     Children = new childContainer(interntroll);
 }
开发者ID:BGCX262,项目名称:zuneusermarketplace-svn-to-git,代码行数:8,代码来源:Class1.cs


示例18: AddControlToForm

 protected override void AddControlToForm(IControlHabanero control, int formHeight)
 {
     System.Windows.Forms.Form frmLocal = new System.Windows.Forms.Form();
     DisposeOnTearDown(frmLocal);
     frmLocal.Controls.Add((System.Windows.Forms.Control)control);
     frmLocal.Height = formHeight;
     frmLocal.Visible = true;
 }
开发者ID:Chillisoft,项目名称:habanero.faces,代码行数:8,代码来源:TestReadOnlyGridControlWin.cs


示例19: Timer

        public Timer(System.Windows.Forms.Form owner, int interval) {
            this.Tick += Timer_Tick;

            gParent = owner;

            gnInterval = interval;
            gbWork = false;
            gThread = new System.Threading.Thread(Timing);
        }
开发者ID:inmount,项目名称:dyk.dll,代码行数:9,代码来源:Timer.cs


示例20: Init

        public void Init()
        {
            // Create a windows form so that we can use its handle for the sim connection
            System.Windows.Forms.Form form = new System.Windows.Forms.Form();
            IntPtr handle = form.Handle;

            SimManager.Initialise(handle);
            Assert.That(SimManager.Instance, Is.Not.Null, "SimManager singleton initialised");
        }
开发者ID:GeoDirk,项目名称:fsxi,代码行数:9,代码来源:SimManagerTest.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Forms.GroupBox类代码示例发布时间:2022-05-24
下一篇:
C# Forms.FolderBrowserDialog类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap