473,385 Members | 1,325 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,385 software developers and data experts.

.Focus Question...

I have two forms in my windows application, one have two textboxes, one have
a group box and two textboxes inside the group box, when i do .Focus() in
the first form, it works fine, however, when i do it on the second form, the
textboxes just couldn't get the focus... seems that control inside group box
can't get the focus via .Focus()
How can i get around this?
Thanks
Tony
Nov 15 '05 #1
1 1708
Can you try this:

at from two:

this.Controls[2].Focus();

"this" is mean for form 2
index number "2" is assum your text box inside this form was have array
index of two.

hope this help

Kate

"Tony" <li***********@hotmail.com> wrote in message
news:O7**************@TK2MSFTNGP12.phx.gbl...
I have two forms in my windows application, one have two textboxes, one have a group box and two textboxes inside the group box, when i do .Focus() in
the first form, it works fine, however, when i do it on the second form, the textboxes just couldn't get the focus... seems that control inside group box can't get the focus via .Focus()
How can i get around this?
Thanks
Tony

Nov 15 '05 #2

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

Similar topics

7
by: Chris | last post by:
I'm using eight links listed horizontally as a menu on my site. I'm using font-variant:small-caps and they are padded so that they mimic buttons. My gripe is with the way IE handles the focus...
5
by: Melissa | last post by:
1. Is there a way to programatically remove the focus from the form; ie, so the focus is not on any control on the form? 2. Is there a way to programatically set the focus to the same place as...
3
by: Frederik Vanderhaegen | last post by:
Hi, I've written a sort of wizard in which the user has to answer some questions. This wizard contains a radiobuttonlist en two buttons (back and next). With the first question there's no...
2
by: joe | last post by:
Question about javascript -> onblur='self.focus' I use the method <body onblur='self.focus'> to keep the child browser always on the top , it success, but the textbox inside the child browser can...
7
by: Zytan | last post by:
I want to set a control in a form to have the default focus. This is not the accept button -- that's set to a button when is 'clicked' when you press ENTER. I want a textbox to have the focus...
8
by: Nivetha | last post by:
I have requirement like the first page contains LoginName and CompanyName after typing the value clicking Submit button so i am giving in body onload="document.forgotPassword.loginName.focus();...
10
by: blaine | last post by:
Hey everyone! I'm not very good with Tk, and I am using a very simple canvas to draw some pictures (this relates to that nokia screen emulator I had a post about a few days ago). Anyway, all is...
2
by: Jonathan N. Little | last post by:
As part of a JavaScript precheck form validation I noticed a problem with trying to return focus to the field with an error. I have setup a demo page. ...
3
by: Simon | last post by:
Dear reader, On the event "Lost focus" I make the ComboBox invisible but the massage pops up "You can't hide a control that has the focus." But this code is written in the "Lost focus"...
1
by: john ciriello | last post by:
I created a form and put a button and a label on it. I set the tabstops to false. When I first run it I can click the button and there is no focus rectangle. Which is what I want. However, if I...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.