well, the problem with that is that the activate event wont only fire at form_load I guess you should declare a boolean variable like this so that it would only happen once, otherwise everytime your form gets activated, your focus will move to textbox1
VB Code:
Private Sub Form1_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Activated
Static firstActivate As Boolean = False
If Not firstActivate Then
TextBox1.Focus()
firstActivate = False
End If
End Sub
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB ) VB.NET to C# conversion tips!!
Originally posted by Fat_N_Furry Thanks for the help, guys. Unfortunately, it didn't work. The code you posted, MrPolite, is the same as follows, correct?
VB Code:
Static firstActivate As Boolean = False
If firstActivate = True Then
TextBox1.Focus()
firstActivate = False
End If
This requires the user to unselect, and then reselect the form, and every time they do so, it gives focus back to the text box.
well you have to change your code to if firstActive = false, otherwise it will never run
The code I wrote ^ would select the textbox only the first time the form is activated (when it's loaded). So I thought that's what you want, isnt it? did you try my code? that works
If you put that code in form_activate, it will select TextBox1 when the form is loaded and it would aviod doing the same thing if the form gets activated again.
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB ) VB.NET to C# conversion tips!!
tabpage was for another thread
btw puting code in paint event wouldnt be good. If the user switches to another program and then switches back to your app, it will cause a paint event to fire, which will then cause the focus to move! (ouch)
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB ) VB.NET to C# conversion tips!!
Originally posted by DevGrp ...anyway off to watch SpiderMan.
LOL my stupid family is going to watch that possibly tonight on DVD for the second time. I almost *never* watch a movie twice, because I know what's going to happen - good guys win, bad guys die or are put in prison for life, and have an evil twinkle in their eye at the end of the movie, forshadowing the sequel where they escape and wreak havoc. My SISTER, however, will watch a movie 10-15 times, literally! I swear her brain is a big gooey mush. And then there's my brother, which I will not discuss in public.
Anyway, now that I've given you information about my family that you probably didn't want to know, back to the topic of focus. Does anybody know what's wrong with it?
Furry
Eat long and prosper!
If someone helps you, find someone you can help.
If you still have time, click on the darn banner up there and help the forum!
Originally posted by Fat_N_Furry LOL my stupid family is going to watch that possibly tonight on DVD for the second time. I almost *never* watch a movie twice, because I know what's going to happen - good guys win, bad guys die or are put in prison for life, and have an evil twinkle in their eye at the end of the movie, forshadowing the sequel where they escape and wreak havoc. My SISTER, however, will watch a movie 10-15 times, literally! I swear her brain is a big gooey mush. And then there's my brother, which I will not discuss in public.
Anyway, now that I've given you information about my family that you probably didn't want to know, back to the topic of focus. Does anybody know what's wrong with it?
Furry
LOL
umm you wanna upload a part of your project? maybe someone can fix it?
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB ) VB.NET to C# conversion tips!!
hmmmmmmmmmm!!
why cant I set breakpoints in you app?!!!
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB ) VB.NET to C# conversion tips!!
Thanks for everyone's help. I really appreciate it. You're all going to call me a liar for saying this, but I'm going to say it anyway - it still doesn't work. Just to clarify that we're talking about doing the same thing, here, I'll restate what we're trying to do: we're trying to give the rich text box the focus when the form loads, so the users can all just start typing right away. Can anybody think of anything else that could be wrong with this form or the code we're using? Frankly, I'm starting to think I may have a virus or something...
Furry
Eat long and prosper!
If someone helps you, find someone you can help.
If you still have time, click on the darn banner up there and help the forum!
Couldn't you just set the TabIndex of the RTB to 0?
Every passing hour brings the Solar System forty-three thousand miles closer to Globular Cluster M13 in Hercules -- and still there are some misfits who insist that there is no such thing as progress.
doesnt work. Download his project... it's weird . And I also dont know why I cant set any breakpoints in his code
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB ) VB.NET to C# conversion tips!!