473,399 Members | 2,278 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,399 software developers and data experts.

Label in Panl Derived Class

I have a control that inherits from the Panel Class. To this, I added a
label which I want to use as a caption in my derived control. However, I
can't get the label to show up in the panel. I tried a text box and it works
fine. I've tried everything on the label from visible=True, BringToFront,
etc. but I can't get it to show up.

Is this a bug in VS or can one just not do this?
--
Dennis in Houston
Nov 21 '05 #1
7 1490
Dennis,

When you do not set a border or text in a label, you do not see it. Is that
not simple the problem?

Cor
Nov 21 '05 #2
Dennis,

When you do not set a border or text in a label, you do not see it. Is that
not simple the problem?

Cor
Nov 21 '05 #3
Thanks Cor but I've tried different borders as well as text. If I just add a
panel to a form then a label to the panel, it works fine. However, it
doesn't work from my derived control (derived from a panel). Thanks for
answer though.

"Cor Ligthert" wrote:
Dennis,

When you do not set a border or text in a label, you do not see it. Is that
not simple the problem?

Cor

Nov 21 '05 #4
Dennis,

I have selected an item usercontrol
Draged on that a panel docked it.
Draged "on" that a label

Build the solution

Set that usercontrol on a form

Debug

And than I see "Label1"

I hope this helps somehow?

Cor
Nov 21 '05 #5
Yes that works fine. But what I actually have is a control that I'm working
on that derives from a panel class. I add a label control to my derived
control and save that as a dll assembly.

I then start a new project and add my new control to the form. It's then
that I can't get the label to show up. If I add a label in my new project to
my control, it shows up fine but the one I added before doesn't show.

What I'm trying to do is create a control that has some Cells in a grid. I
add a text box and a label and then save it as user control assembly.dll.

I then start my new project and add an instance of my new control to a form.
The textbox shows up fine but the label won't show nor will a combo box,
listbox, button, etc. Only the text box shows up. The controls are there
becuse I can reference them in my control but no matter what I do, they
aren't visible.

Sorry if this is confusing. It's just that I'm getting frustrated with VS
not doing what it should do easily.

"Cor Ligthert" wrote:
Dennis,

I have selected an item usercontrol
Draged on that a panel docked it.
Draged "on" that a label

Build the solution

Set that usercontrol on a form

Debug

And than I see "Label1"

I hope this helps somehow?

Cor

Nov 21 '05 #6
Dennis,

When you give your questions in riddles you get the same answers and does
cost a lot of time to the people who wants to help in this newsgroup.

In my opinion is the last question very different from your first as well as
from your second.

Are you sure this code is at least in your usercontrol about the label?
Me.Label1.Location = _
New System.Drawing.Point(1, 1)
Me.Label1.Name = "Label1"
Me.Label1.Text = "MyLabel"
Me.Controls.Add(Me.Label1)

And than especially the last row?

I hope this helps?

Cor
Nov 21 '05 #7
Sorry about the lengthy explaination but I wasn't sure you were understanding
my problem. Your last note solved my problem. The line
"Me.Controls.Add(Me.Label1) wasn't being added by the Designer. All the
other lines were added correctly but not that one. Strange the Designer
would not add the most important line. Thanks for help. All the controls I
add to my control show up fine now if I add the line manually.

"Cor Ligthert" wrote:
Dennis,

When you give your questions in riddles you get the same answers and does
cost a lot of time to the people who wants to help in this newsgroup.

In my opinion is the last question very different from your first as well as
from your second.

Are you sure this code is at least in your usercontrol about the label?
Me.Label1.Location = _
New System.Drawing.Point(1, 1)
Me.Label1.Name = "Label1"
Me.Label1.Text = "MyLabel"
Me.Controls.Add(Me.Label1)

And than especially the last row?

I hope this helps?

Cor

Nov 21 '05 #8

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

Similar topics

2
by: Peter Flickinger | last post by:
I have been using a label with the TreeView control - to simulate the ghost image of a node during drag/drop (so that a ghost of the node appears to be floating next to the cursor on a drag/drop)....
9
by: Larry Woods | last post by:
I have a method in my base class that I want ALL derived classes to use. But, I find that I can create a "Shadow" method in my derived class that "overrides" the method in my base class. Can't...
0
by: Dennis | last post by:
I have a control that inherits from the Panel Class. To this, I added a label which I want to use as a caption in my derived control. However, I can't get the label to show up in the panel. I...
4
by: Dabbler | last post by:
I'm trying to block out some text by setting Label width attribute which renders as a span tag so that all labels for textfields take up the same amount of space hence the textfields are all...
6
by: Taran | last post by:
Hi All, I tried something with the C++ I know and some things just seem strange. consider: #include <iostream> using namespace std;
2
by: Richard Lewis Haggard | last post by:
I'm trying to derive a class from the Label class and things are not going quite right. I derived the class by doing the obvious: public class LabelGrid : Label But I don't seem to be able...
0
by: nave11 | last post by:
How to add Context menu to a class derived from System.Windows.Forms.Label ? This label will be dragged on a designer surface on runtime. For example, to add a context menu with "Copy" and "Paste"...
12
by: vbnewbie | last post by:
I am having problems accessing properties of dynamically generated objects in VB2005. Can someone please help? In a nutshell: My app creates an equal number of checkboxes and labels that share the...
5
by: Dennis Jones | last post by:
Hello, I have a couple of classes that look something like this: class RecordBase { }; class RecordDerived : public RecordBase {
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
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
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.