Kirk_G Posted July 30, 2003 Posted July 30, 2003 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 Quote
Kirk_G Posted July 30, 2003 Author Posted July 30, 2003 That worked perfectly, thanks again for fixing my code JABE!! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.