![]() |
[SOLVED] Best way to limit input in cell |
Post Reply ![]() |
Author | |
wakerunner ![]() Groupie ![]() Joined: 29 September 2007 Status: Offline Points: 85 |
![]() ![]() ![]() ![]() ![]() Posted: 02 April 2011 at 4:06pm |
I have cells that I want to allow input of numbers only, what is the best way to do this? I don't see a keypress event, is the "previewkeydown" event the only way to do this?
|
|
Product: Xtreme SuitePro (ActiveX) version 13.3.1
Platform: Windows 7 64 bit Language: Visual Basic 6.0 |
|
![]() |
|
markmark ![]() Senior Member ![]() Joined: 30 November 2007 Status: Offline Points: 142 |
![]() ![]() ![]() ![]() ![]() |
This is how I have done this
Private Sub wndReport_InplaceEditChanging(ByVal Row As XtremeReportControl.IReportRow, ByVal Column As XtremeReportControl.IReportColumn, ByVal Item As XtremeReportControl.IReportRecordItem, newValue As String, Cancel As Boolean)
If Len(newValue) <> 0 Then Cancel = Not IsNumeric(newValue) End If End Sub |
|
Product: Xtreme SuitePro (ActiveX) version 13.0.0
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 |
|
![]() |
|
Aaron ![]() Senior Member ![]() Joined: 29 January 2008 Status: Offline Points: 2192 |
![]() ![]() ![]() ![]() ![]() |
Hi, You can also prevent user from typing non numerical characters... And following does for entire column. You can also set this for single ReportItem when adding records.
With wndReportControl .AllowEdit = True
With .Columns
With .Add(.Count, "Col 1", 100, True) .EditOptions.EditControlStyle = xtpEditStyleNumber End With End With
End With
|
|
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.... |
|
![]() |
|
wakerunner ![]() Groupie ![]() Joined: 29 September 2007 Status: Offline Points: 85 |
![]() ![]() ![]() ![]() ![]() |
Great, thanks for the help!
|
|
Product: Xtreme SuitePro (ActiveX) version 13.3.1
Platform: Windows 7 64 bit Language: Visual Basic 6.0 |
|
![]() |
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 |