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

What exactly does Form.TopLevel = false do?

Standard Framework documentation goes into great detail

" A top-level form is a window that has no parent form, or whose parent form
is the desktop window. Top-level windows are typically used as the main form
in an application."

So why is it that standard windows events fail to work in textboxes with
..TopLevel = false forms?

////(inside the load event of a form)

Form f = new Form();
f.TopLevel = false;
this.Controls.Add(f);
f.Show();
TextBox text = new TextBox();
text.Location = new Point(10,10);
text.Size = new Size(100, 20);
f.Controls.Add(text);
text.Text = "Word word word word";

---END--

Then try clicking on the textBox to set the focus just before one of the
letters, it doesn't work.
Entire words are selectable with a double click but single click focus
changes fail.


Nov 17 '05 #1
1 13119
Aha, I was doing this the wrong way.

Form f = new Form();
f.MDIParent = f;
f.Show();
TextBox text = new TextBox();
text.Location = new Point(10,10);
text.Size = new Size(100, 20);
f.Controls.Add(text);
text.Text = "Word word word word";

All sorted now.

"Uchiha Jax" <i_************************@NOSPAMhotmail.com> wrote in message
news:ec*****************@newsfe5-gui.ntli.net...
Standard Framework documentation goes into great detail

" A top-level form is a window that has no parent form, or whose parent form is the desktop window. Top-level windows are typically used as the main form in an application."

So why is it that standard windows events fail to work in textboxes with
.TopLevel = false forms?

////(inside the load event of a form)

Form f = new Form();
f.TopLevel = false;
this.Controls.Add(f);
f.Show();
TextBox text = new TextBox();
text.Location = new Point(10,10);
text.Size = new Size(100, 20);
f.Controls.Add(text);
text.Text = "Word word word word";

---END--

Then try clicking on the textBox to set the focus just before one of the
letters, it doesn't work.
Entire words are selectable with a double click but single click focus
changes fail.

Nov 17 '05 #2

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

Similar topics

3
by: David Mertz | last post by:
At the suggestion of one of my correspondents, I slightly reluctantly implemented an RSS feed for my website/writing. It is perhaps a bit crude so far, but maybe I'll spiff it up. The RSS also...
1
by: Yasutaka Ito | last post by:
Hi, I have an MDI application, in which I want to embed one form (System.Windows.Forms.Form) into a specified area of my MDI application. This is, wihtout affecting the capability of other child...
11
by: Fabio | last post by:
How Can I open a form inside a panel of other form? Is it possible??? Thanks in advance, Fabio
7
by: John | last post by:
Hi I have a panel to which I have added several forms as follows; form1 = New frmone form1.TopLevel = False Me.MyPanel.Controls.Add(form1) form1.BringToFront() form2 = New frmtwo
21
by: StriderBob | last post by:
Situation : FormX is mdi child form containing 2 ListViews ListView1 contains a list of table names and 4 sub items with data about each table. ListView2 contains a list of the columns on each...
2
by: Billy | last post by:
Hello! I have a main form as MDIContainer in VB.NET 2002 App. Form has menu which call several forms. I call forms that way: -- Dim f As New frmNameX() LoadForm(f) -- Procedure LoadForm...
3
by: EdB | last post by:
Here's what I'm going for. I have an edit form to be used when adding new entries. What I am envisioning for the search/edit process would be a form that would have filtering text & combo...
0
by: A_PK | last post by:
Hi I got the following environment.......Form1 and inside Form1, got Panel1.... I also got another new Form ...named Form2... Form1, Panel1 Form2 Inside Form1, I click a button to show Form2...
4
by: BrianP | last post by:
I have a form that is currently being displayed in a split container with panel 1 holding a treeview and panel2 holding the form. my code for this is here. This is when selecting a item from the...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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
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...
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.