473,395 Members | 1,341 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,395 software developers and data experts.

How to perform Undo for Form Controls in C#?

I have wizard kind of Windows Application with Forms having Prev & Next buttons. Currently i have set the Location for all the Forms on Form_Load() method using this.Location = new Point(100, 100);

Now my requirement is that when using "Extend my Windows desktop onto this monitor” setting in Display/Settings Properties, the form should stay in the user’s selected monitor. When i go to the Next form it defaults to the main monitor.
I tried removed the size setting on Form_Load but when i navigate to the next/prev forms the location of the form is not properly set. It randomly positions itself.
How can i do this?
Feb 15 '08 #1
1 1334
vanc
211 Expert 100+
I have wizard kind of Windows Application with Forms having Prev & Next buttons. Currently i have set the Location for all the Forms on Form_Load() method using this.Location = new Point(100, 100);

Now my requirement is that when using "Extend my Windows desktop onto this monitor” setting in Display/Settings Properties, the form should stay in the user’s selected monitor. When i go to the Next form it defaults to the main monitor.
I tried removed the size setting on Form_Load but when i navigate to the next/prev forms the location of the form is not properly set. It randomly positions itself.
How can i do this?
I think you have to read the resolution of desktop before you put your form. When you extend you desktop windows will change its resolution, which is I don't know the differences, you should investigate it yourself, if there is only one monitor then nothing to say if there are some extended monitors then you have to recalculate all startup position to put your form at right place.

Cheers.
Feb 17 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Roger | last post by:
form A has a command button that opens form B in dialog mode DoCmd.openForm "frmProductPrice", acNormal, , , acFormEdit, acDialog, productId form B is a tabular form with 3 'required' fields ...
1
by: Laertes | last post by:
In the Form_beforeupdate event : while the command Me.Undo works perfectly the Me.MyControl.Undo doesn't !!! I would like to make it work as I don't want to undo the changes in the whole form, but...
2
by: Lyn | last post by:
Hi, I have a text control on a form which is bound to table field StartDate which is in Date format. When updating the table record via the form, any data entered into the StartDate control is...
18
by: Darryl Kerkeslager | last post by:
I don't do much with subforms - in fact I've deliberately avoided them - but .... I have a tab control that will contain several subforms, each bound to a separate table, and each table/subform...
4
by: Lee Chapman | last post by:
Hi, Can anyone tell me why in the code below, the call to ClearChildViewState() has no effect? To paraphrase the code: I'm using view state. I have a textbox and a submit button (and a label...
6
by: Raji16 | last post by:
Hi, I am a new member. i am designing a simple judicial database system. however after creating tables i am a bit confused on setting the relationships between tables :confused: here is the link...
7
by: ARC | last post by:
I've noticed that if you use code for the before update command for unbound controls, it doesn't really work. I tried the following: Me!ExportedYN.undo Cancel = True DoCmd.CancelEvent Exit...
3
imrosie
by: imrosie | last post by:
Hello anyone, Is there someone that has a routine to do this? On the Main form I have cmd buttons that clear and undo.. Specifically the Undo doesn't undo the subforms, just the Main form. I...
0
by: Nilam2477 | last post by:
I have a form with multiple TextBox controls and few other controls like comboBox, checkBox etc. I'm trying to implement Undo functionality for all the controls in the form. I'm using Push & Pop...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.