473,396 Members | 1,693 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.

Label not visible

Hi,
I am trying to create a Label for a Windows Form, with my own code.
Its not being visible. The code being used is the following.

Label x = new Label();
x.Name = "node1";
x.Location = new System.Drawing.Point(200, 200);
x.Text = "Hello";
x.TabIndex = 1;
x.Show();
x.Refresh();
Can someone help.
Thanks
Nov 16 '05 #1
2 3914
Hi Xarky,

You need to put the Label into a container control, for instance a windows
form.

this.Controls.Add(x);

--
Happy Coding!
Morten Wennevik [C# MVP]
Nov 16 '05 #2
Hi,

I think you got to add it to the place where you want it to be visible..
in ur case it seems that u want it to be displayed in the form..

so ...

Label x = new Label();
x.Name = "node1";
x.Location = new System.Drawing.Point(200, 200);
x.Text = "Hello";
x.TabIndex = 1;
this.Controls.add(x);

Nirosh.
"Xarky" <be*********@yahoo.com> wrote in message
news:bc*************************@posting.google.co m...
Hi,
I am trying to create a Label for a Windows Form, with my own code.
Its not being visible. The code being used is the following.

Label x = new Label();
x.Name = "node1";
x.Location = new System.Drawing.Point(200, 200);
x.Text = "Hello";
x.TabIndex = 1;
x.Show();
x.Refresh();
Can someone help.
Thanks

Nov 16 '05 #3

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

Similar topics

2
by: Xerxes | last post by:
Hi, can you tell me how I can make a <label> hidden? I have hidden the field after the label: var M_Hide = isNS4?'hide':'hidden'; var M_Show = isNS4?'show':'visible'; ..... <label...
5
by: dcstech | last post by:
I have a label that will not display. On the form load event I wrote "label1.visible=false". when my routine get at the end of the code I inserted "label1.visible=true". I have had a similar...
7
by: Jared | last post by:
Here is my situation. I have multiple labels on a form but only certain ones will become visible while using the form. Depending on which check box(s) you pick, on another form, determines the...
31
by: jcrouse | last post by:
Is there a quick and easy way to change the color of a label controls border from the default black to white? Thank you, John
3
by: Neil Wallace | last post by:
Hi, This is an odd one. I've been struggling to get "double click" to work well for my controls. The same event handler works perfectly for buttons, but not for labels. Can anyone tell me...
1
by: shelleybobelly | last post by:
Hi, I am trying to use the ItemCommand in a datagrid (web form) to display *fields* from the specific row. Each row in the dataset has a primary key. The dataset single table is filled from a...
3
by: rockdale | last post by:
Hi, All: I have a datagrid with TemplateColumn as following: <asp:TemplateColumn Visible="False" > <ItemStyle Width="0px"></ItemStyle> <ItemTemplate> <asp:Label id="lblMin_Value"...
5
by: dgardner | last post by:
This one has me stumped and I hope someone can help. I have a form with a button on it. When I click the button, I want a label named lblWait to be visible. (When the form opens, the label is...
2
by: =?Utf-8?B?Y2FzaGRlc2ttYWM=?= | last post by:
Hi, I have a Label on a Windows form (Version 1.1.4322) and while I iterate recursively through a method I want to show the name of the current file being copied to another directory. The...
9
by: =?Utf-8?B?RnJhbmsgVXJheQ==?= | last post by:
Hi all I have a MDI Container Form, with one label control on the Background of this container form. When I now open a child form, this form is behind the label ... and this looks ugly ... :-))...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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
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...
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.