473,386 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

textbox focus

Hi,

I have a dialog box with a multiline textbox and three buttons. The
obvious thing I'm suffering with is how to give focus to the textbox,
so that when the dialogbox pops up, the user could immediately start
typing without having to click in the textbox.
I tried textBox.Focus(), textBox.SelectAll() with no success... The
tabindex of the textbox is set to 0, which should mean that the
textbox would have the focus when the dialogbox is shown....But it
isn't focused.

Any ideas?
Nov 15 '05 #1
2 4934
hi,

for me

textBox.BringToFront();

works,

hope it does for you too
"zdavid" <za******@mail.tiszanet.hu> schreef in bericht
news:c8**************************@posting.google.c om...
Hi,

I have a dialog box with a multiline textbox and three buttons. The
obvious thing I'm suffering with is how to give focus to the textbox,
so that when the dialogbox pops up, the user could immediately start
typing without having to click in the textbox.
I tried textBox.Focus(), textBox.SelectAll() with no success... The
tabindex of the textbox is set to 0, which should mean that the
textbox would have the focus when the dialogbox is shown....But it
isn't focused.

Any ideas?

Nov 15 '05 #2
Are you using a groupbox? If the textbox is inside you need to set focus
to the groupbox first, then the textbox.

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Albinas | last post by:
Hi all, I am trying to customize the text box to suit the practice of my app. And I am working about the focus behavior of text field. I have met the the following problem. When I set the...
4
by: Mad Scientist Jr | last post by:
I have a textbox that i am adding to (in codebehind of ASP.NET) and need to ensure that the focus is scrolled to the bottom of the textbox each time the page refreshes, and then set focus to a 2nd...
0
by: Jonas L | last post by:
Hi, I need to create a textbox which acts as a normal textbox but with the following extra requirements: 1) In-focus color, when the textbox gets focus the backcolor property of the textbox...
2
by: Jesper | last post by:
Hi, I'm showing a usercontrol containing a textbox on the screen by clicking a notifyIcon in the taskpane. I use textBox.Focus() to set the focus for the texbox, and I also get a blinking...
2
by: Jesper | last post by:
Last week I posted this for the first time. However, I didn't get any useable solution to my problem. I'm very keen on getting this problem solved, so please excuse me for trying again. I'll try to...
0
by: Mad Scientist Jr | last post by:
I have a textbox that i am adding to (in codebehind of ASP.NET) and need to ensure that the focus is scrolled to the bottom of the textbox each time the page refreshes, and then set focus to a 2nd...
3
by: Joe Delphi | last post by:
Hi, I have more experience working with Windows.Forms than with WebForms and sometimes it trips me up. When my page loads, I want a particular textbox to have the focus. I am attempting to...
5
by: Tosch | last post by:
I have a usercontrol with a label, a textbox, a treeview, a grid and a couple of checkboxes. The usercontrol is hosted on a form together with a cancel and a accept button. This form is used to...
3
by: Henry Jones | last post by:
VS 2005 On a form I have a tabcontrol with 5 tabs. Each tab has three textboxes on it. When I click on each tab, I would like to have the focus set to the first textbox. On the tabenter...
10
by: engteng | last post by:
When textbox properties enable = False the font in the textbox become gray color. How do I change the gray color to black color ? Regards, Tee
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.