473,508 Members | 3,833 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DateTimpicker Jumping position

9 New Member
I currently have a datetimepicker on a form and a sepertae check box next to it. the dtp is not enabled. When the check box is ticked the dtp becomes enabled, now here lies my problem, when i click the check box to enable the dtp it does enable but it jumps from its position on the form upto the top left corner. If i then click the checkbox again the dtp returns to its original position and is disabled. Here is my code

'if checkbox ticked then enable the datetimepicker
If chkEndDate.Value = 0 Then
dtpEndDate.Enabled = False
ElseIf chkEndDate.Value = -1 Then
dtpEndDate.Enabled = True
End If

Any help would be much appreciated.
May 30 '07 #1
4 1894
Killer42
8,435 Recognized Expert Expert
I don't know what causes this, but as a workaround (hopefully temporary) you could try explicitly moving it into position after enabling it. Or perhaps hide it, enable it, then show it. In other words...

Expand|Select|Wrap|Line Numbers
  1. ' If checkbox ticked then enable the datetimepicker
  2. If chkEndDate.Value Then
  3.   dtpEndDate.Visible = False
  4.   dtpEndDate.Enabled = True
  5.   dtpEndDate.Visible = True
  6. Else
  7.   dtpEndDate.Enabled = False
  8. End If
I have no idea whether this will help, of course.
May 30 '07 #2
umeshj99
11 New Member
I currently have a datetimepicker on a form and a sepertae check box next to it. the dtp is not enabled. When the check box is ticked the dtp becomes enabled, now here lies my problem, when i click the check box to enable the dtp it does enable but it jumps from its position on the form upto the top left corner. If i then click the checkbox again the dtp returns to its original position and is disabled. Here is my code

'if checkbox ticked then enable the datetimepicker
If chkEndDate.Value = 0 Then
dtpEndDate.Enabled = False
ElseIf chkEndDate.Value = -1 Then
dtpEndDate.Enabled = True
End If

Any help would be much appreciated.

Normally a control on form won't move unless you have specified some code to do so. Just check whether you have given any code to set topcoordinate, leftcoordinate etc. of the datetimepicker control, or whether you have used
dtpEndDate.move, which may be getting executed when you click the checkbox or when the datetimepicker control is enabled/disabled.
May 30 '07 #3
WazzaRoberts
9 New Member
I have no code other for moving it other than that listed above.

Killer thanks for that as it is now working, albeit in a work around fasion.
May 30 '07 #4
Killer42
8,435 Recognized Expert Expert
I have no code other for moving it other than that listed above.

Killer thanks for that as it is now working, albeit in a work around fasion.
What version of VB is this? I think I ran into a similar problem in VBA under MS Access some time ago. Don't think I ever found a solution, but I didn't look very hard, as it wasn't a real application I was working on anyway.
May 30 '07 #5

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

Similar topics

6
1678
by: Steve Lefevre | last post by:
Hey folks -- I have a series of selectboxes on a web form. I would like to have a javascript jump the focus to the next selectbox when the user presses a key. Each box has the values 1 through...
17
1628
by: compassSoftware | last post by:
Hi, I have two horizontal frames, one on top of the other. The top frame is an image map of a street with property boundary's on it. The bottom frame is a table with each row of the table...
2
11467
by: Scott Eade | last post by:
I am using select()/focus() to position the cursor at a particular field on a form. This works, but when the user presses the Tab key in IE the cursor jumps to the address bar rather than the next...
3
1737
by: jalkadir | last post by:
By jump I mean ending unexpectedly. The program below, like the jumping beens, has an unusual behaviour. When the noted lines are not present the program terminates disregarding the rest of the...
2
1253
by: Chris Dunaway | last post by:
I can't believe that this late in the day that no has mentioned yet that VS2005 is now available on MSDN!! I figured there would be shouts ringing though the hills!
0
941
by: Anonymous | last post by:
Crossposted to relevant groups. When using VS2003 to develop ASP.NET apps, you open up an aspx page and have a "canvas" to work on. You can drop controls from the toolbox onto the page, and then...
0
1253
by: Phil Stanton | last post by:
I have a form with 3 Tab Controls, one of which has a continuous subform with an image in the footer. If on the main form, I move through the records using the navigation buttons, the Cursor...
1
1895
by: Terry | last post by:
Hi again folks, After getting my page (http://theamazing.onlinewebshop.net/spotlight/) to work in Firefox and Safari. I thought I would try to get in working in IE. My attempt is here:...
1
1412
by: ranpelt | last post by:
Hi folks, After getting my page (http://theamazing.onlinewebshop.net/spotlight/) to work in Firefox and Safari. I thought I would try to get in working in IE. My attempt is here:...
0
7229
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
7129
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
7333
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
7061
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
7502
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...
0
5637
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
5057
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
3194
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1566
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.