473,386 Members | 1,741 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,386 software developers and data experts.

How does the VS2005 designer environment work?

Hi folks,
Consider a custom class that's being derived from the TextBox and has
got the following propert:

public override string Text
{
get { return "get"; }
set {base.Text = "set";}
}

This new control, say, myTextBox is placed on a form. In this
scenario, the textbox shows the "set" text while at the same time the
Text property in the properties panel of the visual studio says that
the text is equal to "get". The question is that what's happening on
the designer?

The second problem is that when some properties of the myTextBox
control is changed, say, the ScrollBars property and the like. As soon
as this property is changed (I guess those that ends up in refreshing
the control in designer), the text shown in the textbox will change to
"get".

Any help to solve the problem would be highly appreciated,

Cheers,
Mehdi

Feb 6 '07 #1
1 1256
mehdi,

Here is the problem. When you drop the control on the form the designer
serializes the control and it correctly serializes setting the Text
property to the "get" string. Next step is to create the control and the
designer executes the serialized code in the InitializeComponent it executes
the set accessor and there you just write "set" the the base text property
that's why you get "set" ot the screen. On the other hand when the property
browser wants to show the value of the Text property it uses the *get*
accessor which always returns "get" and that is what you see on the property
browser. If you want to fix that just write correct *get* and *set*
accessors that in the simple case will use the base class Text property.
--
HTH
Stoitcho Goutsev (100)
"mehdi" <me***********@gmail.comwrote in message
news:11**********************@h3g2000cwc.googlegro ups.com...
Hi folks,
Consider a custom class that's being derived from the TextBox and has
got the following propert:

public override string Text
{
get { return "get"; }
set {base.Text = "set";}
}

This new control, say, myTextBox is placed on a form. In this
scenario, the textbox shows the "set" text while at the same time the
Text property in the properties panel of the visual studio says that
the text is equal to "get". The question is that what's happening on
the designer?

The second problem is that when some properties of the myTextBox
control is changed, say, the ScrollBars property and the like. As soon
as this property is changed (I guess those that ends up in refreshing
the control in designer), the text shown in the textbox will change to
"get".

Any help to solve the problem would be highly appreciated,

Cheers,
Mehdi

Feb 6 '07 #2

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

Similar topics

5
by: tindog | last post by:
I seem to be caught in a bit of a conundrum with C#. First of all getting books on VS 2003.net then VS 2005 comes out and further a book I have bought to just learn just the language C# (in 21...
8
by: Rob Dob | last post by:
The following code works fine when executed, however will not display correctly within the VS2005 Designer, why is this? is this a bug? it works fine in VS2003, If I move the ASP:Panel to also...
1
by: Rich | last post by:
I have a solution that is in development under VS2003 and has been 'ported' to VS2005. The painful experience of running this newer version of VS revolves around one form. This form is very dense...
5
by: GaryDean | last post by:
(my original post was inaccurate but this post accurately describes what I think is a very bad vs2005 bug) short description... Deleting a dataset and recreating it from the dataadapter causes...
14
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it...
1
by: Rolf Welskes | last post by:
Hello, I set in the configuration file of the application: <system.web> <pages styleSheetTheme="E01_Theme01" /> ...... This works.
5
by: guy | last post by:
http://blogs.msdn.com/ericnel/archive/2006/10/17/top-level-technologies-products-not-supported-on-windows-vista.aspx are MS really saying that they do not have a development enviropnment for...
1
by: Frank | last post by:
Every once in a while I'll close VS2005 with a UserControl (that contains another UserControl) open in the designer. Then when I open VS2005 the next time the designer window will display a...
5
by: =?Utf-8?B?cm9kY2hhcg==?= | last post by:
hey all, i was wondering if the following code snippet from a 1.1 exerpt still apply in asp.net 2.0 framework: #region Web Form Designer generated code override protected void OnInit(EventArgs...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.