Print Page | Close Window

MaxLength and SpinButton Bug

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=10512
Printed Date: 08 May 2024 at 1:39am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: MaxLength and SpinButton Bug
Posted By: Bernie
Subject: MaxLength and SpinButton Bug
Date 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



Replies:
Posted By: Aaron
Date 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 mk:@MSITStore:C:\Program%20Files\Codejock%20Software\ActiveX\Xtreme%20SuitePro%20ActiveX%20V12.0\Help\SymbolReference.chm::/XtremeReportControl~ReportControl~InplaceButtonDown_EV.html - InplaceButtonDown  and mk:@MSITStore:C:\Program%20Files\Codejock%20Software\ActiveX\Xtreme%20SuitePro%20ActiveX%20V12.0\Help\SymbolReference.chm::/XtremeReportControl~ReportControl~ValueChanging_EV.html - 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 mk:@MSITStore:C:\Program%20Files\Codejock%20Software\ActiveX\Xtreme%20SuitePro%20ActiveX%20V12.0\Help\SymbolReference.chm::/XtremeReportControl~ReportControl~InplaceButtonDown_EV.html - InplaceButtonDown  and mk:@MSITStore:C:\Program%20Files\Codejock%20Software\ActiveX\Xtreme%20SuitePro%20ActiveX%20V12.0\Help\SymbolReference.chm::/XtremeReportControl~ReportControl~ValueChanging_EV.html - 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....


Posted By: braian87b
Date 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.


Posted By: Bernie
Date 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


Posted By: AndreiM
Date 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).
 


-------------
Regards,
Andrei Melnik



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net