MaxLength and SpinButton Bug |
Post Reply |
Author | |
Bernie
Senior Member Joined: 05 July 2007 Location: Taiwan Status: Offline Points: 109 |
Post Options
Thanks(0)
Posted: 05 May 2008 at 8:22pm |
1. Set MaxLength = 3 2. Add a spinbutton for a cell
3. Add up the number using the spinbutton (of course, Up arrow)
4. The increasing number will be more than the max number it should be. In this case is 999
|
|
Bernie Ho, Planning Manager + IELTS specialist + part-time programmer
Taiwan, R.O.C |
|
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
Hi,
The definition of MaxLength Property (in the help)
DescriptionGets\sets the maximum number of characters that can be entered when editing an item. So, you can not use this property for the spinbutton value. Now, what do we want? Oh yes, adding a spinbutton. Let's look up the AddSpinButton method.
RemarksA spin control with two buttons is displayed and you can use this button to change the cell numeric value. You can use the InplaceButtonDown and ValueChanging events to determine the new value and compare it to the old value to determine which button was pressed (up or down arrow). Oh thats wonderfull, I can actually check the value myself. Lets add these events...
Private Sub wndReportControl_InplaceButtonDown(ByVal Button As XtremeReportControl.IReportInplaceButton)
''Me.Caption = "InplaceButtonDown " & Button.Item.Value End Sub Private Sub wndReportControl_ValueChanged(ByVal Row As XtremeReportControl.IReportRow, ByVal Column As XtremeReportControl.IReportColumn, ByVal Item As XtremeReportControl.IReportRecordItem)
MsgBox "ValueChanged " & Item.Value End Sub Private Sub wndReportControl_ValueChanging(ByVal Row As XtremeReportControl.IReportRow, ByVal Column As XtremeReportControl.IReportColumn, ByVal Item As XtremeReportControl.IReportRecordItem, NewValue As Variant, Cancel As Boolean)
MsgBox "ValueChanging " & NewValue End Sub
Huhhhh ??? This doesn't work. The ValueChanging event is fired (just before ValueChanged) when the item looses focus. So now I can check the old value with the new value??? Its a little late for that...
In the Remark: You can use the InplaceButtonDown and ValueChanging events to determine the new value and compare it to the old value to determine which button was pressed (up or down arrow).
haaaaahahaha, thats very funny (which button was pressed). The new value is higher then the old value, oh yeah the button UP was pressed... I am lost here. Lots of events but no solution.
Ok, stop joking, lets get serious. Why can't we have properties like the PropertyGrid spinbutton:
It would be so much easier
Thanks
|
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
braian87b
Groupie Joined: 01 April 2008 Location: Argentina Status: Offline Points: 35 |
Post Options
Thanks(0)
|
Amazing answer!, im agree with you, but sometimes is better write a little more and have the things made in the correct way.
|
|
Bernie
Senior Member Joined: 05 July 2007 Location: Taiwan Status: Offline Points: 109 |
Post Options
Thanks(0)
|
That's what I wanted to say. but unfortunately, current reportcontrol can't do this and we still don't know if this feature will be added in 12.0.1?
|
|
Bernie Ho, Planning Manager + IELTS specialist + part-time programmer
Taiwan, R.O.C |
|
AndreiM
Moderator Group Joined: 18 August 2007 Status: Offline Points: 132 |
Post Options
Thanks(0)
|
The following properties will be added in the next version:
ReportInplaceButton.SpinButtonMin;
ReportInplaceButton.SpinButtonMax; ReportInplaceButton.SpinButtonStep; Also InplaceEditChanging event will be sent when spin button pressed to allow you create custom conditions (for example different min/max for different rows).
ValueChanging and ValueCahnged will be sent in the end of cell editing (no for each spin button click).
|
|
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 |