Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - MaxLength and SpinButton Bug
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

MaxLength and SpinButton Bug

 Post Reply Post Reply
Author
Message
Bernie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 July 2007
Location: Taiwan
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bernie Quote  Post ReplyReply Direct Link To This Post Topic: MaxLength and SpinButton Bug
    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
Back to Top
Aaron View Drop Down
Senior Member
Senior Member
Avatar

Joined: 29 January 2008
Status: Offline
Points: 2192
Post Options Post Options   Thanks (0) Thanks(0)   Quote Aaron Quote  Post ReplyReply Direct Link To This Post Posted: 17 May 2008 at 3:03am
Hi,
 
The definition of MaxLength Property (in the help)

Description

Gets\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.
 

Remarks

A 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:
  • SpinButton.Max
  • SpinButton.Min
 
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....
Back to Top
braian87b View Drop Down
Groupie
Groupie


Joined: 01 April 2008
Location: Argentina
Status: Offline
Points: 35
Post Options Post Options   Thanks (0) Thanks(0)   Quote braian87b Quote  Post ReplyReply Direct Link To This Post Posted: 27 May 2008 at 10:20am
Amazing answer!, im agree with you, but sometimes is better write a little more and have the things made in the correct way.
Back to Top
Bernie View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 July 2007
Location: Taiwan
Status: Offline
Points: 109
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bernie Quote  Post ReplyReply Direct Link To This Post Posted: 28 May 2008 at 3:23am
  • SpinButton.Max
  • SpinButton.Min

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
Back to Top
AndreiM View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 18 August 2007
Status: Offline
Points: 132
Post Options Post Options   Thanks (0) Thanks(0)   Quote AndreiM Quote  Post ReplyReply Direct Link To This Post Posted: 22 June 2008 at 1:14pm
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).
 
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.