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

How to set default focus on popup

Hi,
I am able set default focus on user control when it's loaded. using Loaded event. But the visual's are still missing?

Can anyone help?
Oct 4 '10 #1
3 3389
GaryTexmo
1,501 Expert 1GB
What do you mean by "the visual's are still missing?"

?

Your controls aren't showing up on your form? Please post some code so we can help debug the problem.

Thanks!
Oct 4 '10 #2
btnBrowse.Focus() in onLoaded event handler. when i press enter dialog opens but i can't seen where the focus is on the screen dotted rectangle not shown.
Oct 4 '10 #3
GaryTexmo
1,501 Expert 1GB
Ah ok, so I did some digging around and it seems this behaves strangely. Have a look at this thread...

http://www.devnewsgroups.net/windows...ial-focus.aspx

It looks like the Focus method doesn't work during the load part of a form, but does later. I couldn't seem to get it to work unless I put my button's focus on the event of another button's click. I speculated you could also trigger a timer on a form load event to set the focus after a few seconds, but I didn't try it... seems wishy washy anyway.

What did work was putting this in the form's load event...

Expand|Select|Wrap|Line Numbers
  1. this.ActiveControl = theButton
This seemed to work for me... I have no idea why it's different than the focus call. Alternatively you could set up the tab indexes on your form so that the appropriate button had an index of zero.

Hope that helps!
Oct 4 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Franck Pommereau | last post by:
Hi all, I'm building a PyGTK interface in which I would like that no widget would be able to get the focus (and so to be activated by pressing the Return key). For this purpose, for each widget,...
3
by: Brian Henry | last post by:
Hi, I have a bunch of forms in a DLL that I call from my main application. The one form is a login form, and I have the tab order set in the order I want it (password box first, then ok button...
1
by: dotnettester | last post by:
Hi, I have implemented a datagrid where users can change the value of one column. But I have a problem, when a user clicks the 'edit' button and the column to edit changes into a text box. If...
0
by: NH | last post by:
I want to set a control in a content page (i.e. a web form that has a master page) to have the default focus. But I cant figure out how to do it. In a normal web form which doesnt have a master...
4
by: akg | last post by:
Dear Friends, I have a problem. In one of my asp.net form, I have two buttons 'reset' and 'submit' and approx 20 textboxes. through javascript, I am setting focus on first textbox. What I am seeing...
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...
4
by: Jason | last post by:
Hi, Here's the scenario: I have a web application that has window A and window B. A user has both window A and B open - window A is in the foreground and window B is behind it. If the...
4
by: priravi | last post by:
Hi I'm new to this asp.net environment .. i have aproblem like i have a asp page with multiple panel ... the page's default focus is already set to a text box in a panel... now when i click a...
1
by: nsing5 | last post by:
Hi, I am using a jsp. when I open the page in Netscape, the default focus set to the first element of the jspwhile I am not using any get focus script. I don't want to get focus on any item. How...
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:
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.