Multiline FlatEdit & Default Controls |
Post Reply |
Author | ||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
Posted: 27 May 2008 at 12:20am |
|
Hi,
I thought I'd pass on a helpful little code snippet that I am using. First some background: When the FlatEdit control has its MultiLine property set to True and your form contains another control with the Default property set to True, hitting Enter/Return in the FlatEdit control will trigger the Default control. The user needs to press Ctrl+Enter in order to add newlines to the FlatEdit control in this scenario (which may be undesirable). Here's some code that will temporarily hold the default control while the multiline FlatEdit has focus, and restore the default control when the FlatEdit control loses focus:
And to use it:
Hope this is helpful for someone! |
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
|
Jason,
Just curious, when I add a Flatedit and a button (set to default) to a form, the Enter key will set the focus to the button or what? In my case the flatedit does nothing at all with the Enter key (staying in focus thats what it does)
|
||
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.... |
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
Hi Aaron,
Did you put any code in your Button_Click event? Pressing the enter key at any time on a form with a Default button *should* be the same as clicking that button with the mouse (at least it has been that way in my experience). This is usually a desired result, but it is annoying when you need a multiline textbox on a form. |
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
Aaron
Senior Member Joined: 29 January 2008 Status: Offline Points: 2192 |
Post Options
Thanks(0)
|
|
Hi,
Yes, now I know what you mean. It looks more like a bug to me. I don't see this when I use a MS textbox (when focused ENTER is next line) and this is how it should be !!!
|
||
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.... |
||
ijwelch
Senior Member Joined: 20 June 2006 Status: Offline Points: 262 |
Post Options
Thanks(0)
|
|
Can anyone from CJ say if this is going to be changed for 12.1?
|
||
jpbro
Senior Member Joined: 12 January 2007 Status: Offline Points: 1355 |
Post Options
Thanks(0)
|
|
I was hoping SetWindowLong with ES_WANTRETURN would fix this problem, but I just tried it and it didn't help...This is the code I used (in case anyone notices a bug that would prevent it from working):
|
||
Product: Xtreme SuitePro (ActiveX) version 16.2.6
Platform: Windows XP - SP3 Language: Visual Basic 6.0 SP6 |
||
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 |