HighTechTalks DotNet Forums  

Multip[le Windows without MDI

Dotnet Academic General Discussions microsoft.public.dotnet.academic


Discuss Multip[le Windows without MDI in the Dotnet Academic General Discussions forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Phil
 
Posts: n/a

Default Multip[le Windows without MDI - 05-04-2004 , 05:21 PM






How can I cause a secondary window of an application to become active and have focus. I reviewed all the MSDN documentation but still can't seem to get it to work. Essentially I have an application and based on various menu selections I want to display different windows with their own controls for processing or data input

Can anyone provide an example

Thanks
Phil

Reply With Quote
  #2  
Old   
Giacomo
 
Posts: n/a

Default Re: Multip[le Windows without MDI - 05-04-2004 , 08:37 PM






You could try to build the forms separately with a picturebox as the
container and use the API to switch back and forth from screen to screen...
e.g. Build a wrapper class for the handlers... based it on the API
"setparent" and pass the window handles... This one below is 6, but should
port easily to 7.

Public Function RetToParent()
On Error GoTo ErrHandler

Dim lRet As Long

'could be no child form loaded
If mchildPicMainhWnd = 0 Then
Exit Sub
End If

'return the child pic window and remove the references
lRet = SetParent(mchildPicMainhWnd, morigParenthWnd)
If lRet <> 0 Then

'*** use the error handling class here ***
End If

morigParenthWnd = 0
mchildPicMainhWnd = 0

Exit Sub

ErrHandler:

'blah blah blah

End Sub

"Phil" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
How can I cause a secondary window of an application to become active and
have focus. I reviewed all the MSDN documentation but still can't seem to
get it to work. Essentially I have an application and based on various menu
selections I want to display different windows with their own controls for
processing or data input.
Quote:
Can anyone provide an example?

Thanks,
Phil



Reply With Quote
  #3  
Old   
Phil
 
Posts: n/a

Default Re: Multip[le Windows without MDI - 05-05-2004 , 02:11 PM



I appologize but I am neww to Visual Studio and C#, but
Isn't there a way of just having a project with form1 and form2 for example and form1 has a button on it that when it is pressed it shows the second window (Form2)?

Reply With Quote
  #4  
Old   
Giacomo
 
Posts: n/a

Default Re: Multip[le Windows without MDI - 05-05-2004 , 10:30 PM



FORM1.SHOW VBMODAL

"Phil" <psfelice (AT) aol (DOT) com> wrote

Quote:
I appologize but I am neww to Visual Studio and C#, but
Isn't there a way of just having a project with form1 and form2 for
example and form1 has a button on it that when it is pressed it shows the
second window (Form2)?




Reply With Quote
  #5  
Old   
Giacomo
 
Posts: n/a

Default Re: Multip[le Windows without MDI - 05-05-2004 , 10:32 PM



Sorry Phil, I must be more tired than I thought. I didn't see the C#
there.

"Phil" <psfelice (AT) aol (DOT) com> wrote

Quote:
I appologize but I am neww to Visual Studio and C#, but
Isn't there a way of just having a project with form1 and form2 for
example and form1 has a button on it that when it is pressed it shows the
second window (Form2)?




Reply With Quote
  #6  
Old   
Phil
 
Posts: n/a

Default Re: Multip[le Windows without MDI - 05-14-2004 , 08:51 AM



Thanks G.

The Show command was exactly what I needed ...

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.