473,569 Members | 2,791 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

User Control Property Defaults Question

I created a user control. It has a text box in it. Everything works
fine. However, when I place my control on a form, many of the
properties are already in bold. This is supposed to mean that
something other than the default was chosen for those properties. But
that is not correct. The properties are set to their "default" value.

Example of my code for one property:

<Browsable(True ),
DefaultValue(Sy stem.Windows.Fo rms.BorderStyle .Fixed3D),
Description("In dicates whether the EnhancedTextBox will have a
border.")_
Public Overloads Property BorderStyle() As
System.Windows. Forms.BorderSty le
Get
Return TextBox1.Border Style
End Get
Set(ByVal value As System.Windows. Forms.BorderSty le)
TextBox1.Border Style = value
End Set
End Property

I have my "DefaultVal ue" set for this property. And when I place a
new instance of this control on a form, the BorderStyle is Fixed3D,
but it shows in the Properties Window in bold. Why? And how do I fix
this? This property is also in the Designer code of the form I placed
the control on and it should not be. I thought that default values of
properties are not supposed to be in the Designer code.

May 9 '07 #1
0 942

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

Similar topics

0
1535
by: Bruce Wiebe | last post by:
Hi all Ive been tearing my hair out over this for the last couple of days and just cant get it sorted so any help would be greatly appreciated. I have a single asp.net page that simply has a placeholder on it this page loads a control that has placeholders on it into which are injected user controls depending on a database table one of...
1
2247
by: Bruce Rusk | last post by:
I've just started using Stephen Lebans' RTF2 control in a database, linked to a Memo field, and am finding it extremely useful (incidentally, in ACC2002 I'm using the class and withevents rather than the ACC97 backward-compatible module). I do have one question for Stephen or anyone else familiar with the control: what is the best way to...
6
3394
by: Bruce Rusk | last post by:
I'm using Stephen Lebans' RTF2 control in a report, and have discovered what may be a slight bug in it. I have a lot of non-Western language (Chinese) text in my RTF field, and such records get sized strangely using the .RTFHeight property of the control. Specifically, lines of text get cut off the bottom of the control when I use the code...
6
1460
by: Andrea Williams | last post by:
When I step through my code, the ASPX Page_Load happens before the Page_Load in the User Control. This means that the property values are not set to their defaults yet in the User Control and all the properties are blank. So my question is, where is the best place to put the code that handles the form. I was hoping to put it in the...
0
998
by: news.microsoft.com | last post by:
I have a user control with four option buttons depending which option button is pressed I store a score into session object. On the load event of a control the session object is set to 0. There is an optionchecked handler that handles option1.checked,option2,checked etc . This is supposed to update the sessionobject with a score ie 100 A...
3
6733
by: Marty McFly | last post by:
Hello, I have a control class that inherits from System.Web.UI.WebControls.Button. When I drag this control from the "My User Controls" tab in the toolbox onto the form, I want it to reflect the following default properties: Height = 32px, Width = 144px. I declare the Width property in my control as... \\\
11
8123
by: Rimpinths | last post by:
I'm new at developing user controls in C#, and one thing I've noticed right off the bat is that the constructor gets called twice -- once at design time, once at run time. In short, I'm trying to develop a control derived from DataGridView. It will have a default set of columns (but I don't want to create them via the Properties window for...
1
1389
by: brixdotnet | last post by:
Hi there! I made own user control for displaying and editing content. In Page_Load of this control is checked if user is authorized for editing if so, button for editing is shown, otherwise controll works in display only mode. I want now use this control to add new content. The idea is that in another web form, let's call AddNewContent.aspx...
4
2472
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 unsuccessfully in creating the whole pane as a user control and have succeeded in adding the pane and then dynamically adding the content which is a user...
0
7605
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...
0
7917
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8118
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...
1
7665
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7962
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...
0
6277
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...
1
2105
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
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
933
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.