How do I dispaly a Windows Form?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ajm113
    New Member
    • Jun 2007
    • 161

    How do I dispaly a Windows Form?

    Ok I want to display this dialog I made, but I can't figure out how to have it display. I made it under a window Form. I did try this, but it does not work.

    credits.ShowPro pertyDialog();
  • WeCi2i
    New Member
    • Aug 2007
    • 6

    #2
    Originally posted by Ajm113
    Ok I want to display this dialog I made, but I can't figure out how to have it display. I made it under a window Form. I did try this, but it does not work.

    credits.ShowPro pertyDialog();
    Depending on how you did it, you may also need to create an instance of the form first. So if the form is called credits.cs then you need to do something like

    credits myCredits = new credits(); and then show it.

    If you already have an instance of it created then you could do one of the following.

    Try:
    credits.ShowDia log();

    if you want to show the form and have it as the only active thing in your program

    OR

    credits.Show();

    if you want to be able to move between the other windows in your program while the form is showing.

    Comment

    • nmsreddi
      Contributor
      • Jul 2006
      • 366

      #3
      Originally posted by WeCi2i
      Depending on how you did it, you may also need to create an instance of the form first. So if the form is called credits.cs then you need to do something like

      credits myCredits = new credits(); and then show it.

      If you already have an instance of it created then you could do one of the following.

      Try:
      credits.ShowDia log();

      if you want to show the form and have it as the only active thing in your program

      OR

      credits.Show();

      if you want to be able to move between the other windows in your program while the form is showing.

      Hello

      Can you give some explanation what is credits is this a windows form ,where you want to open the dialog actually

      can you post some sample code

      Comment

      • Ajm113
        New Member
        • Jun 2007
        • 161

        #4
        Thanks guys! Also if I may go off subject for a minute is their any place I can look to create a Find & Replace Dialog and a Goto line dialog?

        Comment

        • Floydan
          New Member
          • Aug 2007
          • 24

          #5
          Originally posted by nmsreddi
          Hello

          Can you give some explanation what is credits is this a windows form ,where you want to open the dialog actually

          can you post some sample code
          It was just an example that he gave. When you create a form you can create and instance of that form by using its name.

          So if you create a Form named CreditForm then you instantiate that form by writing:
          Code:
          CreditForm credit = new CreditForm();
          After you have created and instance you can the call the Show or the ShowDialog methods.

          Code:
          CreditForm credit = new CreditForm();
          credit.Show();
          or

          Code:
          CreditForm credit = new CreditForm();
          credit.ShowDialog();

          Comment

          • WeCi2i
            New Member
            • Aug 2007
            • 6

            #6
            Originally posted by Ajm113
            Thanks guys! Also if I may go off subject for a minute is their any place I can look to create a Find & Replace Dialog and a Goto line dialog?
            Do you mean you want to use these in Visual Studio or you want to create dialogs of your own in your application? Both things are very easy if you are just doing them within Visual Studio. On the other hand, if you want to use something like that in your application it is going to take some work.

            Comment

            • Ajm113
              New Member
              • Jun 2007
              • 161

              #7
              Yeah I mean in my own application.

              Comment

              Working...