473,789 Members | 2,122 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

textbox control focus and input

Hello everybody,
I Have a piece of code for a Pocket PC that has a
disabled and hidden textbox control at startup. It is
enabled and set visible programatically . The cursor is
captured calling the focus method.
The problem is: the focus is lost almost inmediately. I
can't type in anything.

See the code below.

Any ideas?

Thank you,

Carlos Lozano

The code is like this:

SetVisible(bool toggle)
{
if (toggle)
{
bool lfocus = false;
tName.Enabled = true;
tName.Visible = true;
tName.Show(); // The control is shown at this point
lfocus = tName.Focus();
/* I found lfocus is true when debugging. Meaning
it got the focus, but seems it lost focus
inmediately.
*/
}
else
{
tName.Visible = false;
tName.Enabled = false;
tName.Hide(); // The control is hidden again
}
}
Nov 15 '05 #1
0 1502

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

Similar topics

4
1900
by: Albinas | last post by:
Hi all, I am trying to customize the text box to suit the practice of my app. And I am working about the focus behavior of text field. I have met the the following problem. When I set the "tabstop" property of a textbox to "False", the textbox does receive focus when user use the mouse to click. However, if I set the "Enable" property to false,
3
1984
by: Hrvoje Voda | last post by:
I would like to when I click radioButton selectFocus on textBox. How? Hrcko
2
14660
by: Jesper | last post by:
Hi, I'm showing a usercontrol containing a textbox on the screen by clicking a notifyIcon in the taskpane. I use textBox.Focus() to set the focus for the texbox, and I also get a blinking text cursor in the textbox. However. I have to click on the usercontrol before it gets the input so that I can type text in the textbox. I would really much like to be able to wirte in the textbox immediately after clicking the notify icon. I've...
8
1700
by: Shawn | last post by:
I have an application that will use barcode scanners to enter an ID to search a database. The main form uses a tab page. I would like people to go to the tab for checking in and just read the barcode without having to hit enter. I also want to keep the number hidden, so I don't want it entered into a visible textbox. TabPages don't have a keypress event, so I'm not sure how to handle this. Thanks...
14
14635
by: teddysnips | last post by:
WINDOWS FORMS I've a form that has a textbox that allows the user to enter a string. On the LostFocus event, the textbox formats the string into a preferred format. However, if the user presses the "Save" button while the textbox has the focus, the LostFocus code doesn't run at the right time, so that the "Save" function is dealing with an incorrectly formatted string and the whole caboodle goes splat.
0
12000
by: Anonieko | last post by:
Are there any javascript codes there? Answer: Yes On the PageLoad event call InitialClientControsl as follows /// <summary> /// This will add client-side event handlers for most of the form controls so
8
5759
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.
2
1650
by: dougmcmurtry | last post by:
I have a web app that is going on a touch screen computer with no keyboard, so I have to allow them to enter numeric data into text fields through a UserControl that I built. All I need to find is which textbox control on the page has focus so I know where to put the input. Any ideas? Thanks all......
0
9656
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
9499
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9969
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...
0
8995
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5404
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...
1
4076
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
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2898
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.