473,320 Members | 1,828 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Fixing a form on the screen

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
5 1939
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Jozef | last post by:
I have some old code that I use from the Access 95 Developers handbook. The code works very well, with the exception that it doesn't seem to recognize wide screens, and sizes tab controls so that...
3
by: Patrick De Ridder | last post by:
If I remove the top band from the form, the form will be fixed on the screen (you cannot move the form about on the screen). Is there a way to stop the form from being moved about, whilst retaining...
12
by: > Adrian | last post by:
How do I fix a form on the screen using VS C# 2005. By "fixing" I mean that the user cannot move the form about on the display. Thanks, Adrian.
3
by: Peter Oliphant | last post by:
I'm programming using MS VS VC++ 2008 Express (Beta 2) in /Cli pure mode. I've found the Screen class. With it I can very easily get the count and all the data on the various Screens attached to...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.