I know I've done this somewhere but I cannot find any example of it in any
of my test code.
I have a form with a Listbox that is filled by a dataset it fills in various
textboxes.
When the form first opens, I have to tab to the listbox so that I can scroll
down the list.
How do I setfocus to the listbox (I know I can change the tab order but I
thought I could move to it with a setfocus method)
Thanks
Charlie 18 1194
Did you try myListbox.Focus()?
BB -----Original Message----- I know I've done this somewhere but I cannot find any
example of it in anyof my test code.
I have a form with a Listbox that is filled by a dataset
it fills in varioustextboxes.
When the form first opens, I have to tab to the listbox
so that I can scrolldown the list.
How do I setfocus to the listbox (I know I can change
the tab order but Ithought I could move to it with a setfocus method)
Thanks
Charlie
.
Thanks BB
I had tried that but it didn't work. Then I went back in to see if I had
done something wrong
and found that I had put the code in the wrong routine.
Thanks
Charlie
<an*******@discussions.microsoft.com> wrote in message
news:05****************************@phx.gbl... Did you try myListbox.Focus()?
BB
-----Original Message----- I know I've done this somewhere but I cannot find any example of it in anyof my test code.
I have a form with a Listbox that is filled by a dataset it fills in varioustextboxes.
When the form first opens, I have to tab to the listbox so that I can scrolldown the list.
How do I setfocus to the listbox (I know I can change the tab order but Ithought I could move to it with a setfocus method)
Thanks
Charlie
.
On Thu, 04 Dec 2003 06:22:08 GMT, "Charles May"
<qu*********@hotmail.com> wrote: Thanks BB I had tried that but it didn't work. Then I went back in to see if I had done something wrong and found that I had put the code in the wrong routine.
You should put it in the Load event of the form, so that focus is
gained as soon as the form is loaded. Make sure the control has the
tabstop property enabled
Hi Charles,
Is it maybe a webform?
Cor I have a form with a Listbox that is filled by a dataset it fills in
various textboxes.
"Pepi Tonas" <Pe*******@hotmail.com> schrieb On Thu, 04 Dec 2003 06:22:08 GMT, "Charles May" <qu*********@hotmail.com> wrote:
Thanks BB I had tried that but it didn't work. Then I went back in to see if I had done something wrong and found that I had put the code in the wrong routine. You should put it in the Load event of the form, so that focus is gained as soon as the form is loaded. Make sure the control has the tabstop property enabled
Setting the focus in the Load event does not work because the control must
be visible to gain the focus.
--
Armin http://www.plig.net/nnq/nquote.html http://www.netmeister.org/news/learn2quote.html
* "Armin Zingler" <az*******@freenet.de> scripsit: I had tried that but it didn't work. Then I went back in to see if I had done something wrong and found that I had put the code in the wrong routine. You should put it in the Load event of the form, so that focus is gained as soon as the form is loaded. Make sure the control has the tabstop property enabled
Setting the focus in the Load event does not work because the control must be visible to gain the focus.
It will work if you show the form in the 'Load' event handler.
;-)
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schrieb Setting the focus in the Load event does not work because the control must be visible to gain the focus.
It will work if you show the form in the 'Load' event handler.
;-)
Yep. But bad design in IMHO (load fires the first time before the form is
shown, so it is not necessary to show it because it's just about to be
shown).
--
Armin
* "Armin Zingler" <az*******@freenet.de> scripsit: Setting the focus in the Load event does not work because the control must be visible to gain the focus.
It will work if you show the form in the 'Load' event handler.
;-)
Yep. But bad design in IMHO (load fires the first time before the form is shown, so it is not necessary to show it because it's just about to be shown).
But it may help to avoid ugly 'Activated' hacks to execute code after
showing the form.
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schrieb * "Armin Zingler" <az*******@freenet.de> scripsit: Setting the focus in the Load event does not work because the control must be visible to gain the focus.
It will work if you show the form in the 'Load' event handler.
;-)
Yep. But bad design in IMHO (load fires the first time before the form is shown, so it is not necessary to show it because it's just about to be shown).
But it may help to avoid ugly 'Activated' hacks to execute code after showing the form.
theform.show
'theform.refresh
theform.thecontrol.focus
--
Armin
* "Armin Zingler" <az*******@freenet.de> scripsit: > Setting the focus in the Load event does not work because the > control must be visible to gain the focus.
It will work if you show the form in the 'Load' event handler.
;-)
Yep. But bad design in IMHO (load fires the first time before the form is shown, so it is not necessary to show it because it's just about to be shown).
But it may help to avoid ugly 'Activated' hacks to execute code after showing the form.
theform.show 'theform.refresh theform.thecontrol.focus
_Inside_ the form's implementation.
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schrieb * "Armin Zingler" <az*******@freenet.de> scripsit:>> Setting the focus in the Load event does not work because >> the control must be visible to gain the focus. > > It will work if you show the form in the 'Load' event > handler. > > ;-)
Yep. But bad design in IMHO (load fires the first time before the form is shown, so it is not necessary to show it because it's just about to be shown).
But it may help to avoid ugly 'Activated' hacks to execute code after showing the form.
theform.show 'theform.refresh theform.thecontrol.focus
_Inside_ the form's implementation.
Why? Does it have to?
--
Armin
* "Armin Zingler" <az*******@freenet.de> scripsit: >>> Setting the focus in the Load event does not work because >>> the control must be visible to gain the focus. >> >> It will work if you show the form in the 'Load' event >> handler. >> >> ;-) > > Yep. But bad design in IMHO (load fires the first time before > the form is shown, so it is not necessary to show it because it's > just about to be shown).
But it may help to avoid ugly 'Activated' hacks to execute code after showing the form.
theform.show 'theform.refresh theform.thecontrol.focus
_Inside_ the form's implementation.
Why? Does it have to?
Now I am your boss: How to do that?
;-)))
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schrieb * "Armin Zingler" <az*******@freenet.de> scripsit:> > But it may help to avoid ugly 'Activated' hacks to execute > code after showing the form.
theform.show 'theform.refresh theform.thecontrol.focus
_Inside_ the form's implementation.
Why? Does it have to?
Now I am your boss: How to do that?
;-)))
To do what?
--
Armin
* "Armin Zingler" <az*******@freenet.de> scripsit: >> But it may help to avoid ugly 'Activated' hacks to execute >> code after showing the form. > > theform.show > 'theform.refresh > theform.thecontrol.focus
_Inside_ the form's implementation.
Why? Does it have to?
Now I am your boss: How to do that?
To do what?
See first line in this post (better: "directly after the form is
shown").
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schrieb >>> But it may help to avoid ugly 'Activated' hacks to execute >>> code after showing the form. >> >> theform.show >> 'theform.refresh >> theform.thecontrol.focus > > _Inside_ the form's implementation.
Why? Does it have to?
Now I am your boss: How to do that?
To do what?
See first line in this post (better: "directly after the form is shown"). > theform.show > 'theform.refresh > theform.thecontrol.focus
--
Armin
* "Armin Zingler" <az*******@freenet.de> scripsit: >>>> But it may help to avoid ugly 'Activated' hacks to execute >>>> code after showing the form. >>> >>> theform.show >>> 'theform.refresh >>> theform.thecontrol.focus >> >> _Inside_ the form's implementation. > > Why? Does it have to?
Now I am your boss: How to do that?
To do what?
See first line in this post (better: "directly after the form is shown").
>> theform.show >> 'theform.refresh >> theform.thecontrol.focus
Yep. After replacing 'theform' with 'Me'.
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> schrieb >>>>> But it may help to avoid ugly 'Activated' hacks to execute >>>>> code after showing the form. >>>> >>>> theform.show >>>> 'theform.refresh >>>> theform.thecontrol.focus >>> >>> _Inside_ the form's implementation. >> >> Why? Does it have to? > > Now I am your boss: How to do that?
To do what?
See first line in this post (better: "directly after the form is shown").
>>> theform.show >>> 'theform.refresh >>> theform.thecontrol.focus
Yep. After replacing 'theform' with 'Me'.
Doesn't work outside.
--
Armin
On Thu, 4 Dec 2003 12:21:28 +0100, "Armin Zingler"
<az*******@freenet.de> wrote: "Pepi Tonas" <Pe*******@hotmail.com> schrieb On Thu, 04 Dec 2003 06:22:08 GMT, "Charles May" <qu*********@hotmail.com> wrote:
>Thanks BB >I had tried that but it didn't work. Then I went back in to see if I > had done something wrong >and found that I had put the code in the wrong routine. > You should put it in the Load event of the form, so that focus is gained as soon as the form is loaded. Make sure the control has the tabstop property enabled
Setting the focus in the Load event does not work because the control must be visible to gain the focus.
That explains why it sometimes works for me and sometimes not.
Appreciate your correction. Thanks This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
by: MLH |
last post by:
A form named frmVehicleEntryForm has a number of textbox
controls who's OnGotFocus property setting is an expression...
=Change2Green()
Change2Green() looks something like this...
Dim MyControl...
|
by: Jason |
last post by:
I have created a c-sharp app that has keyup, keydown events tied to the
form. The form also has some other controls, buttons, labels and 1 custom
control that I made which inherits from user...
|
by: CLEAR-RCIC |
last post by:
Hi,
I'm having problems setting focus to a textbox on a web user contol on an
asp.net web page. The following script works on normal asp.net pages:
<script language="javascript">
function...
|
by: Aung Thu |
last post by:
Hi, there!
I want to set focus on a control, of which TabIndex is not the first, when a
form is loaded. In the form's load event, I have used Control.Focus() but it
doesn't not work. The focus...
|
by: Sridhar |
last post by:
Hi,
I have a question. I have created a user control which contains a
textbox and a button. we will enter some search word in the textbox and hit
the button. Then we will get a pop-up with the...
|
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...
|
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 for...
|
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...
|
by: Finn Stampe Mikkelsen |
last post by:
Hi
How can i set a focus to a textbox in my codebehind page??
I have this WebForm, that takes information from a user and 2 buttons on the
form. One that takes action on the entered...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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
|
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: 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...
|
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,...
|
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...
|
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: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |