![]() |
CommandBarEdit SpinButtons |
Post Reply ![]() |
Author | |
spol ![]() Groupie ![]() Joined: 04 November 2005 Location: Italy Status: Offline Points: 26 |
![]() ![]() ![]() ![]() ![]() Posted: 25 January 2007 at 3:52am |
Hi all,
I would like to create a date-time picker. I added a xtpControlEdit commandbar with the ShowSpinButtons set to true and set its text to now(). But when I click on one spin button the text turn to a number and it work as un up-down counter. Is there a way to intercept the ShowSpinButtons events so that I can add and substract one hour to the the control text? Thanks, Paolo |
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
here workaround:
Private Sub CommandBars1_ControlNotify(ByVal Control As XtremeCommandBars.ICommandBarControl, ByVal Code As Long, ByVal NotifyData As Variant, Handled As Variant)
If (Control.Id = 100) Then If (Code = 4112) Then Control.Text = "Some new Text+" Handled = True End If If (Code = 4113) Then Control.Text = "Some new Text-" Handled = True End If End If End Sub |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
spol ![]() Groupie ![]() Joined: 04 November 2005 Location: Italy Status: Offline Points: 26 |
![]() ![]() ![]() ![]() ![]() |
That's work perfectly !!!
Thank you very much! ![]() |
|
![]() |
|
bobmazanec ![]() Newbie ![]() Joined: 26 April 2007 Location: United States Status: Offline Points: 7 |
![]() ![]() ![]() ![]() ![]() |
I'm doing a similar thing with a simple CommandBarEdit whose value I want to keep positive.
When I set Handled=True (as shown in the "workaround"), I can check the value and modify the Text. However, the Up/Down keys no longer activate the corresponding spinner buttons.
When I leave Handled=False, the Up/Down keys work as expected, but any changes I make to the CommandBarEdit's Text are lost/overridden.
I have also tried checking/setting the Text and setting Handled=True in the Code 768 handler, but still to no avail.
Any suggestions?
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Yes, when control has focus Control.Text property will not work. as solution use SetWindowText API:
Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String) As Long
...
If (Control.Id = 1300) Then If (Code = 4112) Then SetWindowText Control.EditHandle, "Some new Text+" Handled = True End If |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |