473,326 Members | 2,104 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,326 software developers and data experts.

strange error with focus?

Hi all
I have TabControl that hosts some TextBox.
I want to give focus to textBox1 when my form loads..
I use textBox1.Focus() but it dosen't work..
???
Jan 23 '06 #1
3 1034
perspolis wrote:
Hi all
I have TabControl that hosts some TextBox.
I want to give focus to textBox1 when my form loads..
I use textBox1.Focus() but it dosen't work..
???

Are you sure your text box is enabled at the time of setting focus?
Jan 23 '06 #2
You have to first select the TabPage that hosts the TextBox, then do
TextBox.Focus... otherwise it won't work.

Jan 23 '06 #3
On Mon, 23 Jan 2006 17:47:54 +0330, "perspolis" <re*****@hotmail.com>
wrote:
Hi all
I have TabControl that hosts some TextBox.
I want to give focus to textBox1 when my form loads..
I use textBox1.Focus() but it dosen't work..
???

Try selecting the right tab first:
myTabControl.SelectedIndex = 1;
once the right page is visible you should be able to focus on your
text box.

rossum

--

The ultimate truth is that there is no ultimate truth
Jan 23 '06 #4

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

Similar topics

6
by: WindAndWaves | last post by:
Hi Gurus The page below has a strange error. It seems to be working very well, just when you enter 8 or 9 for day, month or year then you get an error. I really have no idea where that is...
0
by: Richard Hollenbeck | last post by:
I've asked this question before but over a month later I still don't have an answer. A few people did try to help and I am thankful, but I really didn't get the problem solved. I'll try to ask...
12
by: Stephen Poley | last post by:
I have a report which prints data from a parent table and two child tables (Contract and Kosten). Because it is a bit long, I suppress some fields which are often empty, based on methods found in...
4
by: SJ | last post by:
Hi all, I have come across a weird problem when attempting to automatically set the focus in a vb.net form to a checkbox control... In my form I have (on a tab page in a tab control) several...
7
by: E | last post by:
I have encountered a very strange problem that is hard to describe, but hope someone has run across it. I have a form that shows a number of columns from a single table in the upper portion of...
2
by: Gidi | last post by:
Hi, I've a strange problem in my form. I have a textBox which i want to get the focus when the form is loaded, so i gave it TabIndex=1 and on the load method i wrote textBox1.Focus(). I have two...
1
by: clickon | last post by:
For testing purposes i have got a 2 step WizardControl. Eqach step contains a text box, TextBox1 and TextBox2 respectively. If i put the following code in the respective activate event handlers...
0
by: Andrew.Raymond | last post by:
I know this one is WAY out pushing the envelope, but I'd like to know if anyone has any ideas about it. We have a behemoth of a legacy MFC application which is now being embedded in a Windows...
5
by: Ian | last post by:
Hi everyone, I have found some bizarre (to me...!) behaviour of the Form_Activate function. I have a form which has a button control used to close the form and a subform with a datasheet view...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.