473,659 Members | 2,609 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Textbox focus again again

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 be a little more precise.

I have an app running (minimized) and without showing itself on the task
bar. It puts an icon in the task pane (next to the clock), and when I click
this icon, a message handler is invoked and creates a new usercontrol on the
screen. This usercontrol contains a textbox. This textbox is the problem.
When the usercontrol appears I would like to give input to the textbox
immediately. I use the focus() method but all that happens is that I get a
text-cursor (flashing in the textbox) and it looks like its ready for input.
However, when I type on the keyboard, nothing happens. I have to click
somewhere on the usercontrol for the textbox to capture input from the
keyboard. I do not think that focus method is the key to the solution, I've
tried several combination from various methods. It looks like the fokus
medthod works on application level - or form - level, and not on Operating
system level - is that correct, any solution to my problem.

Thank you,
Regards Jesper.

Nov 17 '05 #1
2 2009
Perhaps you need a WIN32() like SetFocus() from User32.lib.

Nov 17 '05 #2
1) Focus method is useless when a form is shown for the first time if you
correctly entered TabIndex fields for each component. The field that will
first have focus is the one with the value '0'.

2) However, with Focus method, it would have worked. Do you have 'Enter' or
'GotFocus' that set a focus in one of the parent chain of your textbox ? If
not, how do you show your form ? How do you set the focus ? To your textbox
or to your usercontrol ? Do you have a sample of your code that you could
provide ?

"Jesper" <Je****@discuss ions.microsoft. com> a écrit dans le message de
news:E8******** *************** ***********@mic rosoft.com...
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 be a little more precise.

I have an app running (minimized) and without showing itself on the task
bar. It puts an icon in the task pane (next to the clock), and when I click this icon, a message handler is invoked and creates a new usercontrol on the screen. This usercontrol contains a textbox. This textbox is the problem.
When the usercontrol appears I would like to give input to the textbox
immediately. I use the focus() method but all that happens is that I get a
text-cursor (flashing in the textbox) and it looks like its ready for input. However, when I type on the keyboard, nothing happens. I have to click
somewhere on the usercontrol for the textbox to capture input from the
keyboard. I do not think that focus method is the key to the solution, I've tried several combination from various methods. It looks like the fokus
medthod works on application level - or form - level, and not on Operating
system level - is that correct, any solution to my problem.

Thank you,
Regards Jesper.

Nov 17 '05 #3

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

Similar topics

2
6136
by: JayDee | last post by:
After a user enters data into a field, I need to populate other controls on the form, based on the user entry. I have to use either Leave, Validating or Validated, and I take it I can't use LostFocus because there is no selection for that event in the dropdown list on the code page. What's happening is that all 3 events mentioned above for the textbox control fire in the proper order when the form is invoked, but don't fire the first time...
3
19709
by: Jose Egea | last post by:
Hello: I'm trying to execute a function when the user press Enter key in a TextBox. But something is happening in my form because after pressing a button, when I press the Enter key in the TextBox, the application executes the click event of the last button selected instead of the keypress event of the TextBox. Any key event happen in my form, even the keypreview event is ignored. The propertie AcceptsReturn is set to false and...
0
1154
by: SpotsPlay | last post by:
If I bind a TextBox to a property on a "BusinessObject", the first time that TextBox is edited (each time the form/user control is opened) hitting Tab or clicking on another control on the form/user control does NOT change the focus from that TextBox. Any subsequent Tab or mouse clicks will move the focus as expected. But not the first time any single TextBox is edited on the displayed form/user control. It's not that the carrot moves...
4
3145
by: melanieab | last post by:
Hi, I need to write something so that when a textbox is entered (this is for a touchscreen), all the text in that textbox is selected (highlighted) and new keystrokes replace the old text. Help! Thanks (again), Melanie
1
1759
by: Gill Smith | last post by:
when the page is loaded I am using onload event at the client side and setting the focus on the control(TextBox). However when the user clicks on Clear ImageButton, I am clearing all the text boxes and the grid(previous search result display) in the clicked event of the ImageButton at the server side. How to set the focus on the TextBox again when the user clicks on the Clear button. -Gill
4
2950
by: JC | last post by:
Hello- I have a form which has a listbox, a textbox and a submit button. The user types a phone number into the textbox, clicks button, text gets added to the listbox. After this process I need the focus to be back in the textbox. Sounds easy hu? Here's my code- Private Sub cmdAddLine_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAddLine.Click
1
2044
by: melanieab | last post by:
Hi again, I have a textbox where the text is longer than the textbox width. When I type something in there or even do any single keystroke (other than tab, up, down, or enter) and then leave, the beginning of the string shows, and focus goes on to the next box. But if I just tab through or want to go straight to the next textbox, the beginning of the string is cut off, leaving the end of the string visible. More info that may/may not be...
8
21872
by: cj | last post by:
I asked this question a couple of days ago but am just now looking at it again. I used to use the textbox gotfoucs event to have all the text in the textbox selected when it gotfocus. That doesn't seem to work in .net when the textbox receives focus via a mouse click. Jeffrey and Shane both advised how to get a mouse click to select all the text (thank you both) but using the mousedown or mouseup events doesn't work the way I want it...
8
5743
by: nil | last post by:
Hello all, It's urgent... i want to add autocomplete textbox facility in my application like google. as you type it suggests option to the user..i want the same kind of facility...i know i can do only with ajax(xml and javascript) but i want to fetch possible values from database and want to show as the user types in text box.
0
8428
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8751
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8539
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8630
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4176
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4342
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2759
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.