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.
4 1894
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... - ' If checkbox ticked then enable the datetimepicker
-
If chkEndDate.Value Then
-
dtpEndDate.Visible = False
-
dtpEndDate.Enabled = True
-
dtpEndDate.Visible = True
-
Else
-
dtpEndDate.Enabled = False
-
End If
I have no idea whether this will help, of course.
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.
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.
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.
Sign in to post your reply or Sign up for a free account.
Similar topics |
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...
|
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...
|
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...
|
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...
|
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!
| |
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...
|
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...
|
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:...
|
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:...
|
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,...
|
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...
| |
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,...
|
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...
|
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: 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,...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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 ...
| |