We help IT Professionals succeed at work.
Get Started

VB&Excel:Text Box Focus

Calico_Cat
Calico_Cat asked
on
174 Views
Last Modified: 2010-04-30
Here's a quick one.  In my program created a custom input box form as i was having difficulty with the given VB one (see other questions).  The new input box work wonderfully except that the input box does not place the cursor in the text box window.  If possible i would like to have the textbox appear with anydefault text highlighted so that it can be easily edited.  How do i Highlight the default text and place a cursor at the end.  I tried
TextBox1.setFocus
but this doesn't seem to work.
Can anyone help.


On a way different track, is there anyway to prevent global variables from resetting when exiting the Sub that calls the  custom input box form.  It tried hiding it at the end of its use but that didn't seem to work.  I have found a way to get around this but i'm kinda curious

Thanks in Advance
Cat
Comment
Watch Question
Commented:
This problem has been solved!
Unlock 1 Answer and 10 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE