473,513 Members | 3,621 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Controls property in designer

I need to expose a property as a list in the designer properties.
Somthing like

Friend Property MyControlChoice as system.string
get
return me._myControlChoice
end get
set value as system.string
me._myControlChoice = value
end set
end property

But the choices need to be a strong typed list so we can extend it. I
have been digging thru attributes and designer documentation but can't
seem to hit on the right way to make this work. Can anyone possibly
shed any light on what is probably a simple mattter?

Thanks.

Apr 3 '07 #1
3 1206
On Apr 3, 1:45 pm, "Tom C" <tom_cla...@asdsoftware.comwrote:
I need to expose a property as a list in the designer properties.
Somthing like

Friend Property MyControlChoice as system.string
get
return me._myControlChoice
end get
set value as system.string
me._myControlChoice = value
end set
end property

But the choices need to be a strong typed list so we can extend it. I
have been digging thru attributes and designer documentation but can't
seem to hit on the right way to make this work. Can anyone possibly
shed any light on what is probably a simple mattter?

Thanks.
Apparently this is not making sense to anyone. What I trying to do is
show this property from a user control class in the windows designer
properties window with a dynamic list in the combobox based on the
type of window that owns the user control.

Does that help anyone help me?

Apr 3 '07 #2
Tom C wrote:
<snip>
What I trying to do is
show this property from a user control class in the windows designer
properties window with a dynamic list in the combobox based on the
type of window that owns the user control.
<snip>

Doesn't a public enum exposed by the control would do?

<aircode>
Public Class MyControl
'...
Public Enum Behavior
Unspecified
Good
VeryAttentive
Adulatory
Bad
Disgusting
Unspeakable
End Enum

Public Property ControlBehavior
'...
End Property
'...
</aircode>

This will appear in the property window when you site your control in
a container.

HTH.

Regards,

Branco.

Apr 4 '07 #3
On Apr 3, 11:47 pm, "Branco Medeiros" <branco.medei...@gmail.com>
wrote:
Tom C wrote:

<snip>What I trying to do is
show this property from a user control class in the windows designer
properties window with a dynamic list in the combobox based on the
type of window that owns the user control.

<snip>

Doesn't a public enum exposed by the control would do?

<aircode>
Public Class MyControl
'...
Public Enum Behavior
Unspecified
Good
VeryAttentive
Adulatory
Bad
Disgusting
Unspeakable
End Enum

Public Property ControlBehavior
'...
End Property
'...
</aircode>

This will appear in the property window when you site your control in
a container.

HTH.

Regards,

Branco.
I should have stated in my original post that an enum appears to be
too limited. It has no inheritance. At best, it can be shadowed. We do
extensive extending of our application for specific clients and the
enum is simply not robust enough. I guess I will take this matter to
the designer forum.

Apr 4 '07 #4

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

Similar topics

3
14140
by: Chris | last post by:
Hi, I'm trying to append text from another class to a generic richTextBox that I've added to a Windows form. I can't seem to figure out how to expose the richTextBox to append text to it. Thanks in advance, Chris
7
2454
by: Mike Bulava | last post by:
I have created a base form that I plan to use throughout my application let call the form form1. I have Built the project then add another form that inherits from form1, I add a few panel controls each with a couple of controls in them I then rebuilt my project and my new panels and all controls they contained are gone... I've looked through...
4
1400
by: Robert | last post by:
I've created a custom control that inherits System.Windows.Forms.UserControl. It consists of three labels next to each other. I am able to access the control's properties and methods, but none of the events I try to raise, such as MouseEnter or MouseDown, will work wtih the control. What's the deal?
1
317
by: Robert | last post by:
This is the code for the custom control: Public Class SPCLabel Inherits System.Windows.Forms.UserControl #Region " Windows Form Designer generated code " Public Sub New() MyBase.New()
3
4980
by: Tom | last post by:
I am writing a Visual basic .Net database application. There are many forms that first let you select and look at a DB record and then when you click a "modify" button you are allowed to change data in the text boxes. Then an "update" button saves the data back to the database. What is the best way to change several properties on most of...
5
11081
by: Christopher Kurtis Koeber | last post by:
Dear All, This may sound like an elementary question but how do you implement scrollbars for the Picturebox control. Do I have to create my own code to do this or is there some property that I can set? Thank you very much for your time and consideration in this matter! Christopher Koeber
8
3159
by: mark.norgate | last post by:
I've run into a few problems trying to use generics for user controls (classes derived from UserControl). I'm using the Web Application model rather than the Web Site model. The first problem I'm having is that the partial class signature in my projectDetails.ascx.cs file looks like this: public partial class...
8
3561
by: Ryan | last post by:
Ok.. I have a form with lots of stuff on it; a tool strip panel, menu strip, data binding elements (dataset, binding source, table adapter), tab control with 7 tab pages, each page contains a picture box, lots of text boxes (for input).. you get the idea. All of a sudden everything on the form has disappeared, it looks like a blank, newly...
15
6477
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt accept other controls. The control i drag drop on it becomes the child of my custom control's parent form and not the child of my custom control. Then...
1
8332
by: Don | last post by:
I'm getting the following exception displayed in the task list at design time for my project: "Code generation for property 'Controls' failed. Error was: 'Object reference not set to an instance of an object.'" I've traced the problem to a custom control I created that inherits from Inherits System.Windows.Forms.TextBox. In this custom...
0
7269
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7559
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
7123
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
5701
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
5100
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...
0
4756
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...
0
3248
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...
0
1611
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
0
470
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.