OK, so i searched this forum, and it seems like my question has come close to
being answered a dozen times, but never fully...
I have a very simple control that inherits from UserControl. It has no
child controls, just properties and custom drawing. I would like one of
these properties to be 'Text'.
So i setup a private _Text field (base.Text not accessible) and public
String Text property. I have tried using both 'override' and 'new' keywords,
but the results appear to be the same, which is limited access to the Text
property when trying to use the control on a Designer form. The best I can
do is to get the property to show up in the IDE property window, but nothing
else. I can set the Text in the property window, but the Form Designer does
not generate the corresponding code to set the property, so when I run my
project, the Text i set has reverted back to the default text. I can
manually go into the designer code and put the line in myself, run the
project, and everything works as expected. If i do the same, but then go
back to the designer and change the Text in the property window, the code i
just inserted gets erased.
I'm assuming this an inheritance issue, since all my other non-inherited
properties exhibit the expected behavior. This seems like it should be an
easy answer, but it's got me frustrated. Is there another issue here, like
the fact that the text property comes from 3 levels of inheritance down? I
know I could probably avoid all this by just changing the property name, but
I'd like to stick with the commonality theme if at all possible.
Thanks in advance,
Joe 2 2194
Try using a declaration as shown at the link below. http://groups-beta.google.com/group/...cb94cfe5?hl=en
--
Tim Wilson
..Net Compact Framework MVP
"Joe" <joe.klecha-AT-digeratisolutions-DOT-net> wrote in message
news:42**********************************@microsof t.com... OK, so i searched this forum, and it seems like my question has come close
to being answered a dozen times, but never fully... I have a very simple control that inherits from UserControl. It has no child controls, just properties and custom drawing. I would like one of these properties to be 'Text'. So i setup a private _Text field (base.Text not accessible) and public String Text property. I have tried using both 'override' and 'new'
keywords, but the results appear to be the same, which is limited access to the Text property when trying to use the control on a Designer form. The best I
can do is to get the property to show up in the IDE property window, but
nothing else. I can set the Text in the property window, but the Form Designer
does not generate the corresponding code to set the property, so when I run my project, the Text i set has reverted back to the default text. I can manually go into the designer code and put the line in myself, run the project, and everything works as expected. If i do the same, but then go back to the designer and change the Text in the property window, the code
i just inserted gets erased. I'm assuming this an inheritance issue, since all my other non-inherited properties exhibit the expected behavior. This seems like it should be an easy answer, but it's got me frustrated. Is there another issue here,
like the fact that the text property comes from 3 levels of inheritance down?
I know I could probably avoid all this by just changing the property name,
but I'd like to stick with the commonality theme if at all possible. Thanks in advance, Joe
I had previously tried setting Browsable and EditorBrowsable..
DesignerSerializationVisibility and Bindable must have did the trick, cause
it works now. Thanks Tom
"Tim Wilson" wrote: Try using a declaration as shown at the link below. http://groups-beta.google.com/group/...cb94cfe5?hl=en
-- Tim Wilson ..Net Compact Framework MVP
"Joe" <joe.klecha-AT-digeratisolutions-DOT-net> wrote in message news:42**********************************@microsof t.com... OK, so i searched this forum, and it seems like my question has come close to being answered a dozen times, but never fully... I have a very simple control that inherits from UserControl. It has no child controls, just properties and custom drawing. I would like one of these properties to be 'Text'. So i setup a private _Text field (base.Text not accessible) and public String Text property. I have tried using both 'override' and 'new' keywords, but the results appear to be the same, which is limited access to the Text property when trying to use the control on a Designer form. The best I can do is to get the property to show up in the IDE property window, but nothing else. I can set the Text in the property window, but the Form Designer does not generate the corresponding code to set the property, so when I run my project, the Text i set has reverted back to the default text. I can manually go into the designer code and put the line in myself, run the project, and everything works as expected. If i do the same, but then go back to the designer and change the Text in the property window, the code i just inserted gets erased. I'm assuming this an inheritance issue, since all my other non-inherited properties exhibit the expected behavior. This seems like it should be an easy answer, but it's got me frustrated. Is there another issue here, like the fact that the text property comes from 3 levels of inheritance down? I know I could probably avoid all this by just changing the property name, but I'd like to stick with the commonality theme if at all possible. Thanks in advance, Joe This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: mrVithan |
last post by:
I create a user control object and show its properties through a propertygrid
object in my application. It is sure that there are 100 hundred of properties
inherited from...
|
by: adbarnet |
last post by:
Hi,
I'm a C++ developer coming fresh to c# for GUI development. For the project
I'm working on, I need a specialised control (a treeview derivative) which
would be very useful in other...
|
by: Crirus |
last post by:
I need to derive the Windows.Forms.Control 2 times so I design a class like
this
Public Class BMControl
Inherits System.Windows.Forms.UserControl
Public Class MapControl
Inherits BMControl
|
by: Juan Pedro Gonzalez |
last post by:
Hi,
I've develpped a reusable UserControl. The only headache it's giving me is
how to hide the inherited properties such as AutoScroll, DockPadding, etc...
wich could cause some visual Anoyances...
|
by: elziko |
last post by:
I have sucessfully created a control that inherits from a UserControl.
Now I want to extend this by adding extra controls but if I try and drop a
control onto the form then I just get the "No"...
|
by: Wayne Brantley |
last post by:
VS2005 RTM
Create a web user control to use as a base class for other web user
controls.
Now, create a new web user control, change the class it inherits from to
your base class and compile....
|
by: Steven Nagy |
last post by:
Hi all,
How would I go about hiding an inherited property?
In particular, I want to hide the 'BackColor' property of the
UserControl class.
I will then implement my own back color related...
|
by: ben m |
last post by:
Hi all - we've recently switched up to 2005, and I'm having trouble
getting the hang of some things, among them, creating a control for the
project. Currently, we use a combination of controls on a...
|
by: Martin |
last post by:
Hi all,
I have made a usercontrol and I want to prevent the ContextMenuStrip
property from being available, how can I do this?
I have tried stuff like
Protected Shadows ContextMenuStrip as...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
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,...
|
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$) {
}
...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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
|
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...
| |