473,326 Members | 2,337 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,326 software developers and data experts.

Add/remove propeties of user controls

Dear All,

I am making a Windows Control Library(user control) using VS.NET & C#.NET. Now, i am facing 3 problems:

1.In this control, i wants to remove some of the properties which are available by default to the controls. These properties must be removed from the 'Properties window' of the usercontrol. Also the user must not be able to set these properties using code.
I am able to remove the properties from the 'Properties window' by inheriting a class from the System.Windows.Forms.Design.ScrollableControlDesig ner & removing the properties by overriding the PreFilterProperties function as show below:
protected override void PreFilterProperties(System.Collections.IDictionary

properties)
{
properties.Remove("BackColor");
}
But, doing so, this property is available to be set from the code. How can i remove this property fully?

2.I wants to create a property for the control which has sub properties, like the
'Location' property of a button, which has sub properties as 'X, Y & Locked'.
My new property for the control must have some subproperties like this. How can i achieve this?

3.I wants to add a property to the user control which allows the user to select a color.
When the user selects this property, it must display the color pallete for selecting the color for the satndard properties like 'BackColor'. Then the user must be able to select the required color from these options & the value must be stored in that specific property.

Kindly help me to acheieve the above scenarios

Best Regards,
Abhilash Chandran
Jun 14 '07 #1
1 1525
kenobewan
4,871 Expert 4TB
Removing a property does not remove it from the framework. Sounds like you need two custom controls to solve your other problems. HTH.
Jun 14 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Greg | last post by:
I have a base class for a label. I want to set a property at the base class level, say AutoSize = true. Then at the form level I want to be able to overide the base class setting so that I can...
9
by: Merlin | last post by:
Hi, My code below doesn't work does anyone have any pointers? All my controls are programically added. Dim i As Int16 For i = 0 To Me.Controls.Count - 1 If Me.Controls(i).Name <>...
9
by: Charles Law | last post by:
I have a form on which user controls are placed at runtime. When a control is added to the form a handler is added for an event that a high-level object raises, which must be handled by the new...
3
by: Zorpiedoman | last post by:
Horay! I have just put the finishing touches on a new User Control... The" Jelly Button" I created a setup program which runs fine. I see the .dll nicely in the GAC. How come it does not...
0
by: Yourself | last post by:
I have the following .aspx code: <%@ Page Language="vb" AutoEventWireup="false" Explicit="True" Inherits="Whatever.DefaultPage" CodeFile="Default.aspx.vb" %> <%@ Register TagPrefix="whatever"...
5
by: Mike TI | last post by:
March 24, 2006 Hi all I am new to VB.NET and am using VB.NET 2005. I have an MDI form with a Split Container Control. On demand I am adding and removing User Controls on Panel 2. I am using...
8
by: hunanwarrior | last post by:
I added textbox controls to a form when user selects amount to create from a combobox as follows: 'Load up the combobox Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As...
1
by: maflatoun | last post by:
Hi, I have a user control that I add dynamically. Once certain action is performed I want to remove it completely. My questions are 1. How do you check to see if a user control already exists...
2
by: =?Utf-8?B?R3JlZw==?= | last post by:
I have the following code the dynamically adds a specific number of controls. for x as integer = 1 to 10 Dim btn as Windows.Forms.Button = New Windows.Forms.Button btn.Name = "btn" & x btn.Text...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
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...
0
isladogs
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 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.