SpeedTriple Posted October 25, 2004 Posted October 25, 2004 Hi Guys, I did a search and did not come up with anything helpful so I'll post my question. I have a SDI application, I then load another winform and set it to ShowDialog() so it is modal to the main SDI winform, however, there are times when I need to allow the user to click on the main SDI window from this modal winform so I need to "suspend" the modal dialog and essentially make it modaless, any ideas how I could accomplish this? Thanks in advance, Mick WinXP Pro SP2 C# 2003 Professional Quote
SpeedTriple Posted October 26, 2004 Author Posted October 26, 2004 *bump* Anyone have any insight? Quote
stustarz Posted October 26, 2004 Posted October 26, 2004 Hi I would think that the only way to accomplish this is to decide how you want it opened before you actually open it, maybe use an IF statement, so when the situation arises that the user is going to need to switch to the main form you open the form 'modalless': (I only do vb sorry!) If ShowModalCondition = True Then frmName.ShowDialog() Else frmName.Show() End If Quote Visit: VBSourceSeek - The VB.NET sourcecode library "A mere friend will agree with you, but a real friend will argue."
SpeedTriple Posted October 26, 2004 Author Posted October 26, 2004 stustarz , Thanks for the response, unfortunately I can't do what you mention as I *always* load dialogs in a modal state to the main form. What I have is an application that is a drawing program, like AutoCAD and I have added the ability for an end user to automate drawing, among other tasks, via an active x scripting editor. On occassion I need to let the user "back in" to the main programs screen from my editor to interact with geometry, etc, so this is where I need to suppress modal on the editor let the user do his thing and then go back to the editor in the modal state. I know this is an arse about face approach but I have inherited this behaviour and it is not going to change. Anyway thanks again and hopefull someone will be able to point me in the right direction :D Mick Hi I would think that the only way to accomplish this is to decide how you want it opened before you actually open it, maybe use an IF statement, so when the situation arises that the user is going to need to switch to the main form you open the form 'modalless': (I only do vb sorry!) If ShowModalCondition = True Then frmName.ShowDialog() Else frmName.Show() End If Quote
Administrators PlausiblyDamp Posted October 27, 2004 Administrators Posted October 27, 2004 Could you not display the form non-modal but make it topmost? Also you may want to handle the deactivate event for the form to decide if you really should allow the focus to be moved back to the main form. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
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.