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. Managed C++/CLI
  4. closing a form/dialog

closing a form/dialog

Scheduled Pinned Locked Moved Managed C++/CLI
questioncsharpc++help
3 Posts 3 Posters 1 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.
  • D Offline
    D Offline
    doneirik
    wrote on last edited by
    #1

    Hi, I asked this question before in the VC++ forum, but I think my question was misunderstood. I´ll try it again with more explanation... I´m making an Windows Form appl. using VC++ .Net 2003. As I start an "Form" is automatically created for me. Then I want to make my own "MessageBox"-like class (due to interference with the "windows.h" header I cannot use the included MessageBox" properly.) I go to Project->Add new Item->Windows Form (.NET) and a new "Form" is created, that I want to use as a dialog box, and I add a Label and an OK-button rto it. In the Forms properties I set: FormBorterStyle = FixedDialog MaximizeBox = False MinimizeBox = False However, I don´t know which property I must set, or which method to call for making the Form close when I push the OK-button. Does anybody have a suggestion? (I display it by calling the ShowDialog() method.) Apart from that it works as a dialogbox (I know there are probably better ways to solve the problem, but I´m quite new to VC/C++, and this seemed like the easiest way around it) regards doneirik

    C A 2 Replies Last reply
    0
    • D doneirik

      Hi, I asked this question before in the VC++ forum, but I think my question was misunderstood. I´ll try it again with more explanation... I´m making an Windows Form appl. using VC++ .Net 2003. As I start an "Form" is automatically created for me. Then I want to make my own "MessageBox"-like class (due to interference with the "windows.h" header I cannot use the included MessageBox" properly.) I go to Project->Add new Item->Windows Form (.NET) and a new "Form" is created, that I want to use as a dialog box, and I add a Label and an OK-button rto it. In the Forms properties I set: FormBorterStyle = FixedDialog MaximizeBox = False MinimizeBox = False However, I don´t know which property I must set, or which method to call for making the Form close when I push the OK-button. Does anybody have a suggestion? (I display it by calling the ShowDialog() method.) Apart from that it works as a dialogbox (I know there are probably better ways to solve the problem, but I´m quite new to VC/C++, and this seemed like the easiest way around it) regards doneirik

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I believe if you call the button IDOK, it will do this for you. If not, then there's a property for what button is the OK button, but the name escapes me. At least, that's the case in C#. Christian I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer

      1 Reply Last reply
      0
      • D doneirik

        Hi, I asked this question before in the VC++ forum, but I think my question was misunderstood. I´ll try it again with more explanation... I´m making an Windows Form appl. using VC++ .Net 2003. As I start an "Form" is automatically created for me. Then I want to make my own "MessageBox"-like class (due to interference with the "windows.h" header I cannot use the included MessageBox" properly.) I go to Project->Add new Item->Windows Form (.NET) and a new "Form" is created, that I want to use as a dialog box, and I add a Label and an OK-button rto it. In the Forms properties I set: FormBorterStyle = FixedDialog MaximizeBox = False MinimizeBox = False However, I don´t know which property I must set, or which method to call for making the Form close when I push the OK-button. Does anybody have a suggestion? (I display it by calling the ShowDialog() method.) Apart from that it works as a dialogbox (I know there are probably better ways to solve the problem, but I´m quite new to VC/C++, and this seemed like the easiest way around it) regards doneirik

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        For your MessageBox problem... In stdafx.h just add #undef MessageBoxA or MessageBox don't remember. To close your dialog take a look at this and I'm going to help you a bit... // Set the accept button of the form to button1. form1->AcceptButton = button1;

        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