473,507 Members | 2,545 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

User Control Doesn't Inherits the Property Added after using it...

Hai,

I've Created a User control for example a Button and i've given the font
of the text as Bold and compiled it. Now i've used this Usercontrol
everywhere in my project. Now i changed the font from Bold Italic to Regular,
and also changed the color. now in my project the changes are not inhertied
in already placed user control Buttons. but if i place a new button then i
can see the latest changes...

what can i do to inherit the latest property into my user control buttons
already exist in my project...
--
Peter...
Nov 21 '05 #1
14 1267
Prabhudhas Peter wrote:
Hai,

I've Created a User control for example a Button and i've given the font
of the text as Bold and compiled it. Now i've used this Usercontrol
everywhere in my project. Now i changed the font from Bold Italic to Regular,
and also changed the color. now in my project the changes are not inhertied
in already placed user control Buttons. but if i place a new button then i
can see the latest changes...

what can i do to inherit the latest property into my user control buttons
already exist in my project...


Are you using [DefaultValue(...)] attribute?
Nov 21 '05 #2
No I am not using [DefaultValue(...)] attribute... what is that...plz let
know about that also....
--
Peter...
"ナ「kasz" wrote:
Prabhudhas Peter wrote:
Hai,

I've Created a User control for example a Button and i've given the font
of the text as Bold and compiled it. Now i've used this Usercontrol
everywhere in my project. Now i changed the font from Bold Italic to Regular,
and also changed the color. now in my project the changes are not inhertied
in already placed user control Buttons. but if i place a new button then i
can see the latest changes...

what can i do to inherit the latest property into my user control buttons
already exist in my project...


Are you using [DefaultValue(...)] attribute?

Nov 21 '05 #3
No I am not using [DefaultValue(...)] attribute... what is that...plz let
know about that also....
--
Peter...
"ナ「kasz" wrote:
Prabhudhas Peter wrote:
Hai,

I've Created a User control for example a Button and i've given the font
of the text as Bold and compiled it. Now i've used this Usercontrol
everywhere in my project. Now i changed the font from Bold Italic to Regular,
and also changed the color. now in my project the changes are not inhertied
in already placed user control Buttons. but if i place a new button then i
can see the latest changes...

what can i do to inherit the latest property into my user control buttons
already exist in my project...


Are you using [DefaultValue(...)] attribute?

Nov 21 '05 #4
Prabhudhas Peter wrote:
No I am not using [DefaultValue(...)] attribute... what is that...plz let
know about that also....


DefaultValue attribute specifies the default value for a property.
Example: (you have int ABC property and dafault value for this is 7)

[Browsable(true),DefaultValue(7)]
int ABC
{
get { return _abc; }
set { _abc = value; }
}

」ukasz
Nov 21 '05 #5
OK thank u...

but i need more info on my prevous psot...please help me..
--
Peter...
"ナ「kasz" wrote:
Prabhudhas Peter wrote:
No I am not using [DefaultValue(...)] attribute... what is that...plz let
know about that also....


DefaultValue attribute specifies the default value for a property.
Example: (you have int ABC property and dafault value for this is 7)

[Browsable(true),DefaultValue(7)]
int ABC
{
get { return _abc; }
set { _abc = value; }
}

ナ「kasz

Nov 21 '05 #6
Mr. ナ「kasz

Please give me the solution for my question...if you did not understand my
Question please let me know i'll explain u more
--
Peter...
"Prabhudhas Peter" wrote:
OK thank u...

but i need more info on my prevous psot...please help me..
--
Peter...
"ナ「kasz" wrote:
Prabhudhas Peter wrote:
No I am not using [DefaultValue(...)] attribute... what is that...plz let
know about that also....


DefaultValue attribute specifies the default value for a property.
Example: (you have int ABC property and dafault value for this is 7)

[Browsable(true),DefaultValue(7)]
int ABC
{
get { return _abc; }
set { _abc = value; }
}

ナ「kasz

Nov 21 '05 #7
Peter,

Assuming that it is in your project, did you already rebuild your complete
project?

Cor
Nov 21 '05 #8
you need to post more information
usercontrol does not inherit propertys
are you trying to inherit the usercontrol?
are you trying to inherit to the user control?

if your trying to inherit the user control you must have
public mustinherit property
bla bla bla

if you are trying to inherit to the user control::
need more infomration on what your trying to do here

are you making a web control library?
are you making a windows control library?

all this information makes a difference.. Please post more info
"Prabhudhas Peter" <Pr*************@discussions.microsoft.com> wrote in
message news:F2**********************************@microsof t.com...
Mr. Lukasz

Please give me the solution for my question...if you did not understand my
Question please let me know i'll explain u more
--
Peter...
"Prabhudhas Peter" wrote:
OK thank u...

but i need more info on my prevous psot...please help me..
--
Peter...
"Lukasz" wrote:
> Prabhudhas Peter wrote:
> > No I am not using [DefaultValue(...)] attribute... what is that...plz
> > let
> > know about that also....
>
> DefaultValue attribute specifies the default value for a property.
> Example: (you have int ABC property and dafault value for this is 7)
>
> [Browsable(true),DefaultValue(7)]
> int ABC
> {
> get { return _abc; }
> set { _abc = value; }
> }
>
> Lukasz
>

Nov 21 '05 #9
OK...All Let me expalin the scenario More clearly:

Consider I've created a User Control for Button.
And I've set the font property in the Code Editer as follows:
(i've written the code in the InitializeComponent() subprogramm itself)

#################################################
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
'
'usrButton
'
Me.BackColor = System.Drawing.Color.AliceBlue
Me.Font = New System.Drawing.Font("Arial", 8.0!, _

System.Drawing.FontStyle.Regular, _

System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Name = "usrButton"

End Sub
##############################################

I've used this function everywhere in my project...
Now i want to change the font Property to "Book Antiqua" & size to 10....

If i change the code here...and i've rebulit the project... now i cant see
tha latest change in the existing Buttons in my project...but if I place a
new control in my project i can see tha latest changes...

So please let me know :
* what should i do to reflect my changes in the existing controls
* whether my approch was correct or not...Is tis the proper way of creating
a
user control.
* If I've done the wrong approach the what is the correct way
* Where can i get the useful information regarding creating the Usercontrols

eagerly awaiting ur reply

--
Peter...
"Cor Ligthert [MVP]" wrote:
Peter,

Assuming that it is in your project, did you already rebuild your complete
project?

Cor

Nov 21 '05 #10
Peter,

What I cannot see in your sample is what is "me".

I thought I had this problem once. To simulate your program, I made this
just in a form. To do it as most people, have I opened my toolbox, browsed
at the exe and selected the control mycontrol (I do never do this kind this
kind of things however to simulate it). Than I have dragged the control on
my form.

If I change in this control the color and run it, than nicely I have a new
color for the button.

\\\
Public Class mycontrol
Inherits Button
Public Sub New()
MyBase.New()
InitializeComponent()
Me.BackColor = System.Drawing.Color.Red
End Sub
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
Private components As System.ComponentModel.IContainer
Private Sub InitializeComponent()
components = New System.ComponentModel.Container
End Sub
End Class
///

I hope this helps,

Cor
Nov 21 '05 #11
Hai ナ「kasz...

Please let me have an idea of "DefaultValue attribute" in VB.Net syntax...

ThnX in advance
--
Peter...
"ナ「kasz" wrote:
Prabhudhas Peter wrote:
No I am not using [DefaultValue(...)] attribute... what is that...plz let
know about that also....


DefaultValue attribute specifies the default value for a property.
Example: (you have int ABC property and dafault value for this is 7)

[Browsable(true),DefaultValue(7)]
int ABC
{
get { return _abc; }
set { _abc = value; }
}

ナ「kasz

Nov 21 '05 #12
Hai ナ「kasz...

Please let me have an idea of "DefaultValue attribute" in VB.Net syntax...

ThnX in advance
--
Peter...
"ナ「kasz" wrote:
Prabhudhas Peter wrote:
No I am not using [DefaultValue(...)] attribute... what is that...plz let
know about that also....


DefaultValue attribute specifies the default value for a property.
Example: (you have int ABC property and dafault value for this is 7)

[Browsable(true),DefaultValue(7)]
int ABC
{
get { return _abc; }
set { _abc = value; }
}

ナ「kasz

Nov 21 '05 #13
Prabhudhas Peter wrote:
Hai 」ukasz...

Please let me have an idea of "DefaultValue attribute" in VB.Net syntax...

ThnX in advance


Oops.. I'm sorry I forgot it's VB group (not C#) ;-)

So, this is that former example (in VB):

Private _abc As Integer = 7

<Browsable(True), DefaultValue(7)> _
Public Property ABC() As Integer

Get
Return _abc
End Get

Set
_abc = Value
End Set

End Property
」ukasz
Nov 21 '05 #14
Prabhudhas Peter wrote:
Hai 」ukasz...

Please let me have an idea of "DefaultValue attribute" in VB.Net syntax...

ThnX in advance


Oops.. I'm sorry I forgot it's VB group (not C#) ;-)

So, this is that former example (in VB):

Private _abc As Integer = 7

<Browsable(True), DefaultValue(7)> _
Public Property ABC() As Integer

Get
Return _abc
End Get

Set
_abc = Value
End Set

End Property
」ukasz
Nov 21 '05 #15

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

Similar topics

5
1498
by: Dan Nash | last post by:
Hi all, I've got a page with a user control on, added via VS. I'm trying to get to a property of the user control (or more precisely, a public var). Here's the code at the top of my aspx...
0
1998
by: Tom | last post by:
I am having a really annoying issue with serialization and a .NET User Control I am writing. For example, let's say I have a couple of classes in my control - first class is like: Public Class...
4
2492
by: Michael | last post by:
Dear all .. If I want to use develop a user control and declare a public property which the type is System.Windows.Forms.GridTableStylesCollection For example : Public Class LookAndView...
5
2860
by: c676228 | last post by:
Hi, I guess I am confused. In aspx script, I mean (you won't use Codebehind="enrollinfo.aspx.vb", but mix code with html and code together) You can access user control's property directly. Since I...
6
4057
by: evandelagrammaticas | last post by:
Hi all. I have spent the better part of a day scouring the newsgroups and I am sure that I must have come across the solution a number of times - but I am still a real newbie at asp.net so please...
2
15043
by: ChrisCicc | last post by:
Hi All, I got a real doozy here. I have read hundreds upon hundreds of forum posts and found numerous others who have replicated this problem, but have yet to find a solution. Through testing I have...
11
1662
by: Web Search Store | last post by:
Hello, I set up a web page with 2 user controls. In classic asp, the first one did all the declarations, and the second one used the values, and could reset it. In ASP.Net so far I can't...
5
2681
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hallo, I have a radiobuttonlist control that is added on a custom Web User Control. This control has a property that exposes the SelectedIndex property of the embedded radiobuttonlist. When...
4
2463
by: =?Utf-8?B?UmljaEI=?= | last post by:
I am trying to create a project using the ASP.NET AJAX accordion control. I would like to dynamically add panes to the control with a form template added when the pane is added. I have tried...
1
1889
by: tshad | last post by:
In VB 2008, I have a user control added to the page in the PageLoad event - but the properties are causing me an error. The program (TakeSurveyTest.aspx) using the control (ContactInfo): <%@...
0
7223
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
7110
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
7314
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
7372
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...
1
7030
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
5623
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用lanning, coding, testing,...
1
5041
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...
0
4702
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...
0
3191
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...

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.