|
-
Oct 7th, 2000, 08:19 PM
#1
Thread Starter
Addicted Member
Forgive my many questions, but I am not very introduced into the windows command such as SetPosWindow and stuff like that, i would like to learn how. But anyways. Here is my question:
If my app gets unselected and then reselected, my combo box always gets selected, and if i am typing really fast andmy app gets de selected and reselected my combo box contents get highlighted/selected and the next key i press overrides it all and it gets ereased.What i wanna do is for it not to select it. Any ideas?
Thanx,
Mikelo
-
Oct 7th, 2000, 08:34 PM
#2
Lively Member
Try to change the focus to another control (the textbox you'r writting in) in the form Setfocus event (or Activate event)
Yesterday is history ... Tomorrow is mistry .. Today is a gift.
VB6 , intermidiat
-
Oct 7th, 2000, 08:47 PM
#3
Thread Starter
Addicted Member
I tried...
Still not working... could you show me an example, i don't know how to use events... Please, i need help.
-
Oct 7th, 2000, 08:56 PM
#4
Code:
Private Sub Form_Activate()
Text1.SetFocus
End Sub
OR, you could set the TabOrder of the control to a big valus like 5000000000. Don't worry if it changes, but if it doesn't, set it even bigger.
-
Oct 7th, 2000, 09:03 PM
#5
Thread Starter
Addicted Member
Thanx..
BUt I am looking for a code that works on a COmboBox
It works on da textbox but not on combo. Thanx anyways:-)
BTW. Combo1.Setfocus don't work :-(
-
Oct 7th, 2000, 09:07 PM
#6
Actually, it will work on most controls. Look througt a control's properties and see if it has a "SetFocus" method. If it does, than you can use that control in place of Text1.
This code just transfers the focus to a textbox so that you won't have to worry about it going into the combo again.
-
Oct 7th, 2000, 09:10 PM
#7
Lively Member
Try put the Tabstop of the combobox to false.
What you got?
Yesterday is history ... Tomorrow is mistry .. Today is a gift.
VB6 , intermidiat
-
Oct 7th, 2000, 09:19 PM
#8
Thread Starter
Addicted Member
Not Quite.
This worked for one thing, but to type again i must always select the box again.
This is what i want and what happens:
1.Form get's Deselected all the time, so it gets re-activated
2.When it gets re activated the combo box selects it self and the next key i press erases it all. so it'll be like this: I am writing" http://ww" (De&Re Select) and then "w." is all that it'll say.
-
Oct 7th, 2000, 09:42 PM
#9
Lively Member
If you means that you are typing within the combo I think this is what you need:
Private Sub Combo1_GotFocus()
Combo1.SelStart = Combo1.SelLength
End Sub
Yesterday is history ... Tomorrow is mistry .. Today is a gift.
VB6 , intermidiat
-
Oct 7th, 2000, 09:43 PM
#10
This code will give the focus to your combobox:
And to select all:
Code:
Combo2.SelStart = 0
Combo2.SelLength = Len(Combo2.Text)
Need...Rest...Argh...*@!#@&!!!...Ahh...This is not life...
-
Oct 7th, 2000, 09:48 PM
#11
-
Oct 7th, 2000, 09:58 PM
#12
Lively Member
According to his problem my code is right that is becose when the combobox got focus the whole text will be selected.
Any way for general we can replace that code by this:
Private Sub Combo1_GotFocus()
Combo1.SelStart = Len(Combo1.Text)
End Sub
But I still insists that the previous was right.
Yesterday is history ... Tomorrow is mistry .. Today is a gift.
VB6 , intermidiat
-
Oct 7th, 2000, 10:10 PM
#13
Yes, but if he's a TRUE beginner, he might use it in anmother way (and even if not, somebody who views the forums may).
-
Oct 8th, 2000, 07:47 AM
#14
Thread Starter
Addicted Member
Thanx so much!
Thanx dude, this code worked perfectly, exactly what I watned.
Text1.SelStart = Text1.SelLength
Mikelo
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|