Hi all,

I am now using a master form to derived my windows forms from.

The problem is - I dont know how!

I have a master form with a menu control across the top, I have then 3
others forms that I want to inherit the master form, I have added inherit
master form etc at the top - in the design view of VS they appear fine.

When it run the application I get a blank (master form) with the menu and
nowt else...

I basically want one of the other forms to load/appear/be visible etc, how
does one call it in - lets say from the click on an item on my menu..?

Any help appreciated - this has been a bit of a show stopper :(

Regards

Rob

Re: I have a master form, but... by Tim

Tim
Tue Jul 13 14:54:29 CDT 2004

It almost sounds like you've made the master form out of the main form. Is
that true? Is so then make sure that the master form is just an added form
to the project. Then ensure that all the other forms inherit from the master
form. When the "Click" event for a MenuItem is fired you can create and
instance of the appropriate form and then show it. Is there more to this
story or does this information get you on the right track?

--
Tim Wilson
.Net Compact Framework MVP

"Rob Meade" <robb.meade@NO-SPAM.kingswoodweb.net> wrote in message
news:f_WIc.2487$lZ5.29398137@news-text.cableinet.net...
> Hi all,
>
> I am now using a master form to derived my windows forms from.
>
> The problem is - I dont know how!
>
> I have a master form with a menu control across the top, I have then 3
> others forms that I want to inherit the master form, I have added inherit
> master form etc at the top - in the design view of VS they appear fine.
>
> When it run the application I get a blank (master form) with the menu and
> nowt else...
>
> I basically want one of the other forms to load/appear/be visible etc, how
> does one call it in - lets say from the click on an item on my menu..?
>
> Any help appreciated - this has been a bit of a show stopper :(
>
> Regards
>
> Rob
>
>



Re: I have a master form, but... by Rob

Rob
Tue Jul 13 15:01:14 CDT 2004

"Tim Wilson" wrote ...

> It almost sounds like you've made the master form out of the main form. Is
> that true? Is so then make sure that the master form is just an added form
> to the project. Then ensure that all the other forms inherit from the
master
> form. When the "Click" event for a MenuItem is fired you can create and
> instance of the appropriate form and then show it. Is there more to this
> story or does this information get you on the right track?

Hi Tim,

Many thanks for the reply.

Turns out after posting here I did a quick google search, the results told
me pretty much what you've said above, when I went to the projects
properties it showed the master form as the one to fire when the application
is run - doh!...so, I've changed that now...

There will indeed be more to this story though! :)

How does one create an instance of the appropriate form...

For example, the master form actually wouldnt make too bad a basic "welcome"
kinda form - just plain, maybe have some instructions on it...basically the
first thing a user would do would be to click "New" from the file menu to
open up the ClientInput form...

Therefore I'd like to create an instance of my ClientInput form...based on
the onclick event (can do this bit)...

Reg's

Rob



Re: I have a master form, but... by Rob

Rob
Tue Jul 13 15:03:49 CDT 2004

Lo

Dim ClientInput As New ClientInput
ClientInput.Show()

Got this much - but it opens a new window each time I click on the New menu
item etc as opposed to loading in a different form to the current window?

Regards
Rob



Re: I have a master form, but... by Tim

Tim
Tue Jul 13 15:17:34 CDT 2004

Ok, so you can use ShowDialog instead of Show if you want the user to
interact with only the newly opened form, do what they need to do, and then
return to the main form. This will start the new form in a modal state.

Private Sub menuItem1_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim ClientInputForm As New ClientInput
ClientInputForm.ShowDialog()
' Do some basic cleanup.
ClientInputForm.Dispose()
End Sub

--
Tim Wilson
.Net Compact Framework MVP

"Rob Meade" <robb.meade@NO-SPAM.kingswoodweb.net> wrote in message
news:FeXIc.2508$i_5.29414544@news-text.cableinet.net...
> Lo
>
> Dim ClientInput As New ClientInput
> ClientInput.Show()
>
> Got this much - but it opens a new window each time I click on the New
menu
> item etc as opposed to loading in a different form to the current window?
>
> Regards
> Rob
>
>