andycharger Posted November 27, 2003 Posted November 27, 2003 I have a MDI Parent Form that im going to use to contain my project. Trouble is that I dont know how to open a child form inside it when it starts. When i click the drop down box to set the load event, I only have the following options: (declarations) Finalize InitializeComponent New So how do I get it to open up a form within the MDI window when I start the application? Thanks Quote
AlexCode Posted November 27, 2003 Posted November 27, 2003 You only have those events because you are focusing the wrong item on the left combo... Assuming that your MDI Form is called 'frmMDI' you have, on the left combo, an item called '(frmMDI Events)'. Here you have all the events the form have, including the one for your task... Load Alex :D Quote Software bugs are impossible to detect by anybody except the end user.
Administrators PlausiblyDamp Posted November 27, 2003 Administrators Posted November 27, 2003 If you go to the left drop down list you should see the form name and under it 'Base Class Events' - select that on the right drop down should now contain more choices - lookl for Load Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
andycharger Posted November 27, 2003 Author Posted November 27, 2003 So what code would I need to put inside the sub? I tried: dim frmshw as Form2 form2.Show And this said: Object reference not set to an instance of an object. Quote
Leaders dynamic_sysop Posted November 27, 2003 Leaders Posted November 27, 2003 you should declare your Form as New , also you are dimming frmshw as Form2 , but then putting Form2.Show , where it should be frmshw.Show. Dim frmshw As New Form2() frmshw.Show() Quote
andycharger Posted November 27, 2003 Author Posted November 27, 2003 It seems to work. However, what im trying to do is launch an application so I can send keystrokes to it WITHIN the MDI window. Is there a way I can contain an application within the MDI window like I do with a form. Reason I ask is that when im sending keystrokes to an application outside of an MDI window, it keeps flicking out to the form and the keystrokes dont go to application as it is not the active window!!! Confused? I am! Help. Quote
AlexCode Posted November 27, 2003 Posted November 27, 2003 adding to the code of dynamic_sysop, you also have to set the MDIParent property, telling what MDIForm is the parent of this new Form... But tell me, you want to put an app inside the MDI form?? What kind of app? If it is a .net app, made by you, you can instansiate the forms but if it is an outside app I think it is impossible... Quote Software bugs are impossible to detect by anybody except the end user.
Mothra Posted November 28, 2003 Posted November 28, 2003 you should declare your Form as New , also you are dimming frmshw as Form2 , but then putting Form2.Show , where it should be frmshw.Show. You also have to set the child form's MDIParent. Like this: Dim f As New Form2 f.MDIParent = Me f.Show() Quote Being smarter than you look is always better than looking smarter than you are.
andycharger Posted November 28, 2003 Author Posted November 28, 2003 The application I am launching is called WINLINK and it is a windows emulator that "pretends" to be a system called Misys. it is an insurance based system. The problem I have is that I want to send keystrokes to the new application. However, everytime I need to send a keystroke to it, the form appears at the front of the screen and therefore becomes the "active" window. Ive tried sendtoback and visible commands to make the form dissappear but it still refers to it whenever it gets to the next line of code. This removes the focus from my WINLINK emulator and obviously keystrokes cannot be sent to it. Any ideas as to how I can get round this? 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.