Skip to main content
gamedev.net
🔒 Locked

callback for a windows form?

Started by sqpat Aug 24, 2008 at 7:27 PM 4 replies 1k views
Original Post
sqpat
sqpat
i've got a form being created and shown as follows:
//TestProj::dialogInit^ dlg = gcnew TestProj::dialogInit();
//dlg->Show();
but when i do this, the form shows up and code continues as normal. i want the code to only continue when the form is closed. i tried a loop but when i do that, the form never responds/refreshes. I assume there needs to be a callback function somehow but i dont know how to make that work for a windows form. where do i declare/supply the callback as an argument, and what kind of callback is it exactly? That kind of stuff. Thanks in advance.
SiCrane
SiCrane
Did you try using ShowDialog() instead of Show()?
sqpat
sqpat
showdialog requires an IWin32Window or some such argument which i need to build a class wrapper to implement that interface in order to make it work, and im unable to implement its get method.
SiCrane
SiCrane
ShowDialog() has a zero parameter overload.
sqpat
sqpat
holy poop, you're right. I must have tried showDialog() last time or something, because it took be a day to find out about the no argument version of Show().


Thanks much.

Edit: Show, not show.
Mike.Popoloski
Mike.Popoloski
Quote:
Original post by SiCrane
ShowDialog() has a zero parameter overload.


Not only that, but System.Windows.Forms.Control implements the IWin32Window interface, which means that you can call ShowDialog with any control as the parameter to have that control act as the parent for the calling dialog.
Mike Popoloski | Journal | SlimDX

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.