By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,967 Members | 1,189 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,967 IT Pros & Developers. It's quick & easy.

Fixing a form on the screen

P: n/a
My program produces a number of overviews, for which
I use different forms, which are displayed. These forms are
displayed at certain positions on the screen. I don't want
the user of the program to start moving them about.

Is there a way to fix displayed forms on the screen so
they cannot be moved about?

Thanks.

--
Patrick
--
Regards,
Patrick De Ridder.
Nov 15 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hi,

Patrick De Ridder wrote:
My program produces a number of overviews, for which
I use different forms, which are displayed. These forms are
displayed at certain positions on the screen. I don't want
the user of the program to start moving them about.

Is there a way to fix displayed forms on the screen so
they cannot be moved about?


Probably you don't want to use Forms for this. Can you use a UserControl
instead? I believe it has a designer like that for forms so it shouldn't be
too different.

Pete
Nov 15 '05 #2

P: n/a
On Thu, 28 Aug 2003 23:42:10 +0100, "Pete" <pv*****@gawab.com> wrote:
Probably you don't want to use Forms for this. Can you use a UserControl
instead? I believe it has a designer like that for forms so it shouldn't be
too different.


If I create a user control and call it like so from the main form

UserControl1 usc = new UserControl1();
usc.Show();

Nothing happens. What is it that I should do instead?

--
Thanks
Patrick De Ridder.
Nov 15 '05 #3

P: n/a
You have to remove all of the buttons on the title bar and then set the
Title bar text to nothing. At this point it becomes possible to anchor your
windows so users can't simply drag them around (there are still other ways
to move your window that are more complex, but I won't go in to how to fix
those here).

On your form set ControlBox, MinimizeBox, MaximizeBox all to false, then set
Text property to an empty string "" or string.Empty. If I missed a property
just do some searching for other buttons that show up in the title bar. You
should probably also set the FormBorderStyle to FixedSingle.

--
Justin Rogers
DigiTec Web Consultants, LLC.

"Patrick De Ridder" <00*@000.com> wrote in message
news:ul********************************@4ax.com...
On Thu, 28 Aug 2003 23:42:10 +0100, "Pete" <pv*****@gawab.com> wrote:
Probably you don't want to use Forms for this. Can you use a UserControl
instead? I believe it has a designer like that for forms so it shouldn't betoo different.


If I create a user control and call it like so from the main form

UserControl1 usc = new UserControl1();
usc.Show();

Nothing happens. What is it that I should do instead?

--
Thanks
Patrick De Ridder.

Nov 15 '05 #4

P: n/a
Patrick,
The easiest way is to make the form borderless, by setting the
FormBorderStyle to None. This also gets rid of the caption.

Another option is to set the ControlBox, MinimizeBox & MaximizeBox
properties to False, then set the Text property to an empty string, you will
still have a border, but no caption, so the user cannot move the form. If
you go this route consider setting the FormborderStyle to a fixed size, or
setting the MinimumSize & MaximumSize to the Size property so the form
cannot be resized.

Handling the Move event for the form and forcing the position to remain
where the form started, causes a awful screen flicker...

Not sure if overriding Control.WndProc & handling WM_MOVING,
WM_WINDOWPOSCHANGING or another Win32 message would help (I've never tried
overriding WndProc yet).

Hope this helps
Jay

"Patrick De Ridder" <00*@000.com> wrote in message
news:oa********************************@4ax.com...
My program produces a number of overviews, for which
I use different forms, which are displayed. These forms are
displayed at certain positions on the screen. I don't want
the user of the program to start moving them about.

Is there a way to fix displayed forms on the screen so
they cannot be moved about?

Thanks.

--
Patrick
--
Regards,
Patrick De Ridder.

Nov 15 '05 #5

P: n/a
Hi,

Patrick De Ridder wrote:
UserControl1 usc = new UserControl1();
usc.Show();


I don't think Show is needed.. make sure it's added to the Controls of your
form/whatever and Anchor/Dock is set properly. It should display okay after
that. I'm not too familiar with the designer in vs (i work by hand) so I
can't say much more than that.

Sorry,
Pete
Nov 15 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.