Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

 

I'm using a dialog in order to change properties of an object:

if (myDialog.ShowDialog() == DialogResult.OK)

{

actFunny();

}

 

actFunny() changes the properties just fine right after the dialog was closed. But the dialog object is still present otherwise I couldn't retrieve the rewuired informations of it. So how do I dispose the dialog object after using it? I've never seen the dialog object beeing disposed in one of the examples. Since I'm giving the dialog necessary parameters in it's constructor it has to be created newly.

Debug me...
  • 2 weeks later...
Posted

I was rethinking my current implementation and found my way of passing and retrieving values of and from my dialog very ugly.

E.g. I have an object X which has three integer values (private members). These values can be changed through a dialog. Object X opens the dialog passing it's three integer values through the dialog's constructor (correct me if that's bad style already).

After the dialog is closed object x needs to know the new values.

Right now my dialog has three public members which hold the three integer values. So after closing the dialog object X reads these fields directly :/

Debug me...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...