473,943 Members | 1,851 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

can't change label on inherited (panel) control

Hi there,

I created my own user control (myControl) containing:
myCaption - docked top
myGrid - docked.fill (datasource: myDataset)
myPanel - docked bottom

This control is added to the form: form1.controls. add(myControl)
I wish to change label-value on myPanel whenever a value of myDataset has
changed (by editing the grid). Since dataset.onchang e doesn't exists, what
events is triggered on change?

I tried to manually change the label-value (mycontrol.myPa nel.lblTotal.Te xt
= "sometext") , from Form1. This had no effect at all. However I CAN set a
default value at initialisation of myPanel. How come?

Thanks in advance!
Nov 21 '05 #1
2 2095
Hello,

One solution is to add a public property to your user control that exposes
the Label to client code.

Public Property TotalLabel() As Label
Get
Return lblTotal
End Get
Set (ByVal value As Label)
lblTotal = value
End Set
End Property
--
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com

"Sjaakie Helderhorst" <wo**@tell.yo u> wrote in message
news:uK******** ******@TK2MSFTN GP15.phx.gbl...
Hi there,

I created my own user control (myControl) containing:
myCaption - docked top
myGrid - docked.fill (datasource: myDataset)
myPanel - docked bottom

This control is added to the form: form1.controls. add(myControl)
I wish to change label-value on myPanel whenever a value of myDataset has
changed (by editing the grid). Since dataset.onchang e doesn't exists, what
events is triggered on change?

I tried to manually change the label-value (mycontrol.myPa nel.lblTotal.Te xt = "sometext") , from Form1. This had no effect at all. However I CAN set a
default value at initialisation of myPanel. How come?

Thanks in advance!

Nov 21 '05 #2
Great that did the trick, now I only need to know the catch the event
whenever a dataset is changed.

"Mike McIntyre [MVP]" <mi****@dotnets howandtell.com> schreef in bericht
news:Om******** ********@TK2MSF TNGP15.phx.gbl. ..
Hello,

One solution is to add a public property to your user control that exposes
the Label to client code.

Public Property TotalLabel() As Label
Get
Return lblTotal
End Get
Set (ByVal value As Label)
lblTotal = value
End Set
End Property
--
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com

"Sjaakie Helderhorst" <wo**@tell.yo u> wrote in message
news:uK******** ******@TK2MSFTN GP15.phx.gbl...
Hi there,

I created my own user control (myControl) containing:
myCaption - docked top
myGrid - docked.fill (datasource: myDataset)
myPanel - docked bottom

This control is added to the form: form1.controls. add(myControl)
I wish to change label-value on myPanel whenever a value of myDataset has
changed (by editing the grid). Since dataset.onchang e doesn't exists,
what
events is triggered on change?

I tried to manually change the label-value

(mycontrol.myPa nel.lblTotal.Te xt
= "sometext") , from Form1. This had no effect at all. However I CAN set a
default value at initialisation of myPanel. How come?

Thanks in advance!


Nov 21 '05 #3

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

Similar topics

1
3071
by: Luiz Rafael Fernandes | last post by:
Hi... i try to serialize a object inherited of label control, as follow: //definition public class WinLabel : System.Windows.Forms.Label { public WinLabel() {} }
4
2524
by: Hai Nguyen | last post by:
I'm learning C sharp and do not like vb much. I'm creatiing a wepage using panel to test myself. I tried to use these code below, which is written in VB, and to transform them to c sharp but I got hard time to understand vb syntax. I don't know if anyone in here can point out which is the equivalent object used in c sharp. Translate these two lines to C sharp: Sub Next_Click(Sender As Object, e As EventArgs) Select Case...
4
16282
by: Mikus Sleiners | last post by:
I can't seem to add new controls to form that is inherited from another form. I have BaseForm wich have table layout on it 2 panelsm and some buttons. Now i create InheritedForm : BaseForm and want to add some new controls and add them to pannels but i can't drag and drop them ... designer does not allow me. Why is that ? Panels and table layout modifiers is set to public.
6
2099
by: David Colliver | last post by:
Hi, using vb.net 1.1 I am trying to add a control to a placeholder but am having problems with it. I do it practically the same way as i do in C# (I have more C# skill than VB.NET)and I have asked someone with more VB experience to look at it and they can't see why it fails.
8
5389
by: =?Utf-8?B?R3JlZyBMYXJzZW4=?= | last post by:
I'm trying to figure out how to modify a panel (panel1) from a backgroundworker thread. But can't get the panel to show the new controls added by the backgroundwork task. Here is my code. In this code there is a panel panel1, that I populate with a lable in the foreground. Then when I click on "button1" a backgroundworker thread in async mode is started. When the backgoundworker thread completes the thread returns a panel to populate...
2
1899
by: AlecL | last post by:
I have a page that has about 5 or 6 user controls ranging from hearders to footers to ad space but when I add a new user control which is a form it gives me the exception "page can have only one server-side Form tag" error. Here is the brief code that I am adding to the code: on top: <%@ Register TagPrefix="uc" TagName="CareerStats" Src="/Controls/CareerStats.ascx" %> and the div where I added the control:
4
11255
by: Phil | last post by:
Hi, How to add programmatically a label into a content page? I tried this but doesn't work: Thanks Phil content page:
5
3492
by: iKiLL | last post by:
Hi All, I am trying to Bulid Windows Mobile Forms Control with C# in VS2005 using CF2. On this control A lable is created and some text set for the control. My problem is that i dont know how lond the text is going to be. so i need to set the height and width of the label a cording to the data. un fortunatly i have not been able to find a simple Auto Resize property
1
260
by: COHENMARVIN | last post by:
I have a asp.net page that does something simple - when the user clicks on a radiobutton, a panel becomes visible beneath the radio button. There is some text below the radio button, and that is displaced downward when the panel appears. This is what I intended. However, this only works in IE6. I find that in IE7, the panel appears, but it appears right on top of the text that should be displaced to a lower position on the page. So the...
0
9970
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
11126
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...
0
10662
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
9865
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...
1
8220
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
7390
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
6088
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
6309
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4911
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

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.