Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

In my program I have custom dialog box that might or might not be open. If the dialog box is open I would like the program to update it at certain times. When I create the dialog box I make it owned by the main program.

 

foreach(Form f in this.OwnedForms)

{

customDialog tempDialog = (customDialog)f;

tempDialog.Zmax = blah;

tempDialog.Zmin = blah;

tempDialog.AutoScaleZ = blah;

}

 

this works fine for now because this dialog box is the only thing that the main program owns. My question is, how can I setup an if statement that only accepts when f is a customDialog box? I tried things like:

 

if(f == customDialog)

if(f == typeof(customDialog))

if(typeof(f) == typeof(customDialog))

 

but all of these caused errors. Any ideas would be appriciated. Thanks

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...