Print Page | Close Window

Textbox/Combos SetFocus & Sel**** Bugs

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=8206
Printed Date: 16 November 2024 at 9:03pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Textbox/Combos SetFocus & Sel**** Bugs
Posted By: mojiro
Subject: Textbox/Combos SetFocus & Sel**** Bugs
Date Posted: 28 September 2007 at 3:51am
when I do

for textboxes
txtName.SelStart = 0
txtName.SelLength = Len(txtName.Text)
txtName.SetFocus

I get no focus, also no visible selection even when I focus the control with mouse/keyboard.

But... the seltext property has the right selected text.

for combos
cmbOption.SelStart = 0
cmbOption.SelLength = Len(cmbOption.Text)
cmbOption.SetFocus

the same as above but here I get visible selection when I customly focus the control.

-------------
Networking Guides...
http://routing.explode.gr



Replies:
Posted By: Oleg
Date Posted: 28 September 2007 at 6:05am
Hi,
Just tried in in new project and it works quite fine. I added Textbox and Button and copied this code to Button_Click.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: gaudetm
Date Posted: 01 October 2007 at 9:48pm
try to evaluate the content of control.text event if text in it nothing for the property text so len of nothing =0 so no selection seem to be a bug with textbox and combobox control from codejock. anybody at codejock have notice this? any solution patch anything...


Posted By: Oleg
Date Posted: 02 October 2007 at 1:13am
Hi,
Please attach small sample project. I have no idea what need to check.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: JimK
Date Posted: 02 October 2007 at 9:58am
Yup, just encountered this myself and it means I have to go back to the good old vb textbox. To reproduce
 
Add a flat edit control, say approx 3 lines high and 40 chars wide. Set multiline to TRUE. Add a keyPress event that says if the text length is greater than 200 to then truncate it.
 
If len(FlatEdit.Text) > 200 then
  Beep
  FlatEdit.Text = left(FlatEdit.Text, 200)
  FlatEdit.Text.SelStart = len(FlatEdit.Text)+1
endif
 
Run the program and start entering text. Make sure you enter enough to fill up more that the number of visible lines in the control, so that it has to scroll the text up in order to display what you are typing.
 
When you get to the 201 char, you will hear a beep but the caret will not be visible.


Posted By: JimK
Date Posted: 02 October 2007 at 10:13am
Oops, just tried the simple steps I suggested earlier and the bug foes not occure :(. This is a bit more complicated that I thought. Will post more info if/when I get time to investigate....



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