Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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

Visit: VBSourceSeek - The VB.NET sourcecode library

 

 

"A mere friend will agree with you, but a real friend will argue."
Posted

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

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