Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
edit box
#1
is it possible to change the amount of characters allowed in an edit box?
for example i have a box that will only accept 4 charachters such as "4000"
i want it to except more like "400000"
thanks
#2
Function Dialog2
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "3"
str e3
if(!ShowDialog("Dialog2" &Dialog2 &controls)) ret

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 223 134 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 Edit 0x54030080 0x200 8 18 96 14 ""
;END DIALOG
;DIALOG EDITOR: "" 0x203000D "*" "" ""

ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case EN_CHANGE<<16|3
,_s.getwintext(lParam)
,if(_s.len>=4)
,,_s.fix(4)
,,_s.setwintext(lParam)
,case IDOK
,case IDCANCEL
ret 1
#3
not quite what im looking for
edit box is already existing
#4
sry didnt read it right
#5
Try to send EM_LIMITTEXT message. But in most cases it will not succeed, because normally the app does not rely on it.

Macro Macro1467
Code:
Copy      Help
SendMessage id(15 "Notepad") EM_LIMITTEXT 4 0
#6
Gint,

That works but once it gets to a certain amount it seems to not work anymore?

For example, it allows 7 characters to be entered...i can change it to allow only 6 or 5 or 4 or any less.

But as soon as I try to allow it more it doesnt let me.

Any other ideas?

Thank you

Edit:

I found this def function

Macro Macro2
Code:
Copy      Help
SendMessage id(22 "Secure Client DB") WM_SETTEXT "7,231,154" 1

With that above I can enter the correct amount which is 7 digits....but when i change it to this...

Macro Macro2
Code:
Copy      Help
SendMessage id(22 "Secure Client DB") WM_SETTEXT "16,231,154" 1

It will not work and just throws a window error back at me.
#7
Gintaras,
Any idea on this sir?

Thank you
#8
No ideas. It is how the program works.
#9
Hmm...

Possible to block the controls of the program to stop it from limiting characters?

Just trying to throw some ideas out there and see if anyone comes up with anything!

Thank you!
#10
Has me stumped...
#11
Quote:Possible to block the controls of the program to stop it from limiting characters?

I think, impossible.
#12
I'm lost on this one. This is a must have for the project i'm developing!

I will continue to thrash at it, if you come up with anything please share!

Thanks

Edit:

Can GetWindowLong and SetWindowLong be used to change the current style of a given child window? If so please give example.
#13
Use SetWinStyle.
#14
I have tried using SetWinStyle but can not figure out exactly what style I need to use?
#15
for what?
#16
To set the style of the window to a normal edit box without limitations.

Also,

found this code on the forum and is it possible this is what may be being used to limit the characters?

Macro Macro
Code:
Copy      Help
,case EN_CHANGE<<16|4
,,_s.getwintext(id(4 hDlg))
,,if(_s.len>3)
,,,key B

That is used in a dialog on here to only allow said number of characters into an edit box in a dialog

If so...anyway around it?

Thanks
#17
Quote:To set the style of the window to a normal edit box without limitations.
Such style does not exist. Only message EM_LIMITTEXT can set Edit control max text length, but if it does not work, the program maybe use something like the code you posted, and you cannot change it if you don't have source code of the program.
#18
I have tried everything I know, completely stumped!

Thank you


Forum Jump:


Users browsing this thread: 1 Guest(s)