473,468 Members | 4,584 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Popup Dialog Position

I have created a custom datetimepicker (following on from a previous thread
"DateTimePicker color").

How do I set the position of a Modal Dialog (a control containing a month
calendar) relative to a control (containing a textbox and a button) on a
windows form? I.e. I want the modal dialog to open just beneath the control
that opened the dialog.

--
Regards
JTC ^..^
Any other suggestions about creating a custom datetime picker would also be
appreciated.
Sep 16 '07 #1
2 11653
Dave,

I would believe it is like any other form. First, you would set the
StartPosition of the dialog to FormStartPosition.Manual. You would then set
the Location property to the location that you want it to open. This
location is relative to the screen. You would have to calculate the
position based on the control that is showing the dialog. This can be done
easily with the PointToScreen method on the Control class.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Dave Anson" <da********@jazzthecat.co.ukwrote in message
news:Xn**********************************@216.196. 109.144...
>I have created a custom datetimepicker (following on from a previous thread
"DateTimePicker color").

How do I set the position of a Modal Dialog (a control containing a month
calendar) relative to a control (containing a textbox and a button) on a
windows form? I.e. I want the modal dialog to open just beneath the
control
that opened the dialog.

--
Regards
JTC ^..^
Any other suggestions about creating a custom datetime picker would also
be
appreciated.
Sep 16 '07 #2
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote
in news:39**********************************@microsof t.com:
Dave,

I would believe it is like any other form. First, you would set
the
StartPosition of the dialog to FormStartPosition.Manual. You would
then set the Location property to the location that you want it to
open. This location is relative to the screen. You would have to
calculate the position based on the control that is showing the
dialog. This can be done easily with the PointToScreen method on the
Control class.

Thanks for the help. The following code resolved the issue....
// Where "this" is my control and, as suggested,
// the "StartPosition" property of the form
// which will appear as a dialog is set to Manual.
_calendarPopUp.Location = this.PointToScreen(new Point(0, this.Height));
// ShowDialog below the control
this._calendarPopUp.ShowDialog();
--
Regards
JTC ^..^
Sep 16 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Marko Lahtinen | last post by:
Hello! A part of my website is protected with a .htaccess file. Can I somehow bypass the username/password dialog ?? Can I somehow "hardcode" the authentication name and password in my php-file...
5
by: et | last post by:
Am I correct in that Popup dialog boxes are not available in asp.net? Like the "Are you sure you want to delete?" with yes/no options? What are ways to do this? Thanks for your help. Am new...
0
by: ramendra | last post by:
Hello, I have a asp.net page which has a button and on selection of which i open a small size popup dialog. the dialog has few input parameters and a default button. when i click on the default...
3
by: ApexData | last post by:
I have a Dialog PopUp Form that is called by the following code: DoCmd.OpenForm stDocName, , , stLinkCriteria, cFormReadOnly, acDialog I would like to set the Visible propery of a Label in this...
10
by: ApexData | last post by:
I can't seem to make a PopUp Dialog form Invisible! 'My main form calls the PopUp DoCmd.OpenForm "F-PAUSE", WindowMode:=acDialog 'My PopUp form "F-PAUSE" contains this code Private Sub...
1
by: shawn gong | last post by:
hi all, I have a popup dialog using GTK, which allows user to select "Yes" or "No". Then the program flows depending on the selected answer. The problem is that func() doesn't not wait for...
1
by: Orit | last post by:
I have a question regarding usage of AJAX Control Toolkit's Popup Control Extender . I am using the Popup Control Extender to display a popup dialog ( panel ) from my asp.net page on click of a...
3
by: Mike Hofer | last post by:
Okay, here's the situation: we want to be able to display ASPX pages in an UpdatePanel. The reasons for this are performance related. The site in development uses *lots* of modal popups from some...
2
gnawoncents
by: gnawoncents | last post by:
Greetings, I have a datasheet, created through VBA, and I am trying to automate setting the column widths to Best Fit. Currently I loop through the controls using the code below 'Set...
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
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,...
0
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...
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,...
1
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
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
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 ...

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.