473,903 Members | 4,560 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1988
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.c om...
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_WINDOWPOSCHA NGING 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.c om...
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
18856
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 they are too big and wind up covering up some of the fields on the main form. Is there any good code out there that works in a similar fashion that will also either a) stretch the form width wise on widescreens or b), rely on height rather than...
3
1492
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 the band at the top of the form? Thank you. Patrick.
12
348
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
1488
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 a system, whether it be a single screen or multiple screen system. I believe the FromControl method of the Screen class can be used to determine which Screen a Form is on. But I can't find how I can place or move a Form onto the Screen of my...
0
9999
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9847
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11282
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10983
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9684
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5894
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6088
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3324
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.