Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Multiple forms

Multiple forms

Scheduled Pinned Locked Moved C#
questiontutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Paddy
    wrote on last edited by
    #1

    I know this is a very basic question but could someone please tell me how to create for example a dialog box for getting user settings ect for my application, or even an about dialog box. Is it as simple as right clicking in the explorer and adding another windows form? If so how do I get my program to display it? Thanks in advance, Paddy.

    M R 2 Replies Last reply
    0
    • P Paddy

      I know this is a very basic question but could someone please tell me how to create for example a dialog box for getting user settings ect for my application, or even an about dialog box. Is it as simple as right clicking in the explorer and adding another windows form? If so how do I get my program to display it? Thanks in advance, Paddy.

      M Offline
      M Offline
      Mazdak
      wrote on last edited by
      #2

      Paddy wrote: Is it as simple as right clicking in the explorer and adding another windows form? Yes. Paddy wrote: If so how do I get my program to display it?

      YourFrm frm = new YourFrm();
      frm.ShowDialog();

      Mazy "The more I search, the more my need For you, The more I bless, the more I bleed For you."The Outlaw Torn-Metallica

      1 Reply Last reply
      0
      • P Paddy

        I know this is a very basic question but could someone please tell me how to create for example a dialog box for getting user settings ect for my application, or even an about dialog box. Is it as simple as right clicking in the explorer and adding another windows form? If so how do I get my program to display it? Thanks in advance, Paddy.

        R Offline
        R Offline
        Rocky Moore
        wrote on last edited by
        #3

        You pretty much have it. It only requires adding another WinForm to your project. In the code you (assuming the name of the new WinForm class is 'Form2') simply something like:

        Form2 dlg = new Form2();
        dlg.ShowDialog();

        when you want to display the form. If can also use "dlg.Show()" if you wish a modeless window. Rocky Moore

        P 1 Reply Last reply
        0
        • R Rocky Moore

          You pretty much have it. It only requires adding another WinForm to your project. In the code you (assuming the name of the new WinForm class is 'Form2') simply something like:

          Form2 dlg = new Form2();
          dlg.ShowDialog();

          when you want to display the form. If can also use "dlg.Show()" if you wish a modeless window. Rocky Moore

          P Offline
          P Offline
          Paddy
          wrote on last edited by
          #4

          Thanks for the help that solves that problem for me. One more question, whats the difference between a windows form and an inherited windows form? Thanks, Paddy.

          R 1 Reply Last reply
          0
          • P Paddy

            Thanks for the help that solves that problem for me. One more question, whats the difference between a windows form and an inherited windows form? Thanks, Paddy.

            R Offline
            R Offline
            Rocky Moore
            wrote on last edited by
            #5

            Paddy wrote: One more question, whats the difference between a windows form and an inherited windows form? An inherited Winform is a cool little beast that allows you to inherit the WinForm from a WinForm that you create in another library (DLL) or you own project (if you compiler before you inherit). You can define one form as your base form with controls, then you inherit that form. It will build a form that looks just like the base form. You can add items to the form, you just cannot modify any of the items on the base form. But you can, at any time, modify the base form and those modifications will bubble up to all inherited forms.. Cool! This is good for a Wizard type window where you have a certian layout. Another use is to simulate a skinning window by creating the base winform with different graphics or colors then dropping in the any of the modified base class DLLs thus changing the appearance of all inherited WinForms that inherit from that base WinForm. There are many uses Inherited Forms! Rocky Moore

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups