vb.net / vs2005

  • Thread starter Thread starter Rob Meade
  • Start date Start date
R

Rob Meade

Lo all,

I'm creating a small app - I've added a menu across the top and some other
menu items - one of which is the "About" - I've set this to centerparent yet
everytime I run it - its always about 10pixels in from the top and left of
the main window - is there something else I need to set to achieve this?

Any information would be appreciated.

Regards

Rob
 
Ok - I've resolved that one - showdialogue on the calling function...

Next question! :o)

How do I prevent this little window from being moved around - I want it to
appear in the center of the parent and be stuck there until the user clicks
ok - I've been through all of the properties in the form and cant see
anything obvious - have played with a few - none made any difference.

Any info appreciated.

Regards

Rob
 
on menu click, all you should need to do is...


dim f as frmAbout
f = new frmAbout

f.MinimizeBox = False 'Hides the minimize button
f.MaximizeBox = False 'Hides the maximize button
f.Locked = true 'prevents the form from being resized or repositioned by the
user
f.StartPosition = FormStartPosition.CenterParent 'centers the form in it's
parent's bounds
f.ShowDialog(Me) 'displays the form, sets it's owner.
 
HI Amdrit,

Thanks for the reply.

I have the "locked" property set on the "about" form already but it doesn't
seem to do anything...

Does it make a difference if its set on the actual form, or whether its
declared programmatically when calling the about form etc?

Any info appreciated.

Regards

Rob
 
Oh, and "locked" doesn't appear when I do this:


Dim About as new About

About.

ie there's no intelliesense for "Locked"...neither is there on the actual
About.vb file - when you look at the properties "Locked" only appears under
"Design" - could it be that this only locks the "design" view, and has
nothing to do with the code/application itself when run?

Regards

Rob
 
No, the Lock() method is avaible from the underlying windows form base, it
is available at run time. Is this your about box from scratch, do you have
any logic in the resize event, initialize, or form_load events? Create a
new form for the project, call it frmTest and replace the logic for about
with frmTest, do you get the same results?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top