Hello,
Can anyone tell me how I can add a custom property to a Form, so that it is
visible in the designer ?
I tried
[
Category("MyCat egory"),
Description("De scription"),
Browsable(true)
]
public int MyProperty
{
get { return m_MyProperty; }
set { m_MyProperty = value; Invalidate(); }
}
But this only seems to work for controls.
Thanks for your help,
Michiel. 2 5098
"Michiel" <mi*********@RE CLAMEpayvision. com> ha scritto nel messaggio
news:%2******** **********@tk2m sftngp13.phx.gb l... Hello,
Can anyone tell me how I can add a custom property to a Form, so that it
is visible in the designer ? I tried [ Category("MyCat egory"), Description("De scription"), Browsable(true) ] public int MyProperty { get { return m_MyProperty; } set { m_MyProperty = value; Invalidate(); } }
But this only seems to work for controls.
Thanks for your help,
Michiel.
Hi Michiel,
Are you sure that you are using a base type like the INT in your example?
If you want to edit or show a custom type you need to assign a valid viewer
for that type, for example:
[Category("Custo m Appearance"),
Description("My BackColor."),
Editor(typeof(Y uorColorEditorT ype), typeof(UITypeEd itor))]
"Mephiston" <me********@ema il.it> wrote in message
news:eu******** ******@tk2msftn gp13.phx.gbl... "Michiel" <mi*********@RE CLAMEpayvision. com> ha scritto nel messaggio news:%2******** **********@tk2m sftngp13.phx.gb l... Hello,
Can anyone tell me how I can add a custom property to a Form, so that it is visible in the designer ? I tried [ Category("MyCat egory"), Description("De scription"), Browsable(true) ] public int MyProperty { get { return m_MyProperty; } set { m_MyProperty = value; Invalidate(); } }
But this only seems to work for controls.
Thanks for your help,
Michiel.
Hi Michiel, Are you sure that you are using a base type like the INT in your example? If you want to edit or show a custom type you need to assign a valid viewer for that type, for example:
[Category("Custo m Appearance"), Description("My BackColor."),
Editor(typeof(Y uorColorEditorT ype), typeof(UITypeEd itor))]
Yes, it's just an int.
I tried adding
Editor(typeof(i nt), typeof(UITypeEd itor))
But that didn't help :( This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Steve Amey |
last post by:
Hi all
I am creating a basic control to perform some tasks, and I want to declare
some events to be raised so they can be handled from the form that the
control is on. I can create my own Event Handler class and use that, but I
would like to use the System.EventArgs class so that my event can be handled
by different controls.
For example:
|
by: James Geurts |
last post by:
Hey all... I posted this in the vs.net ide group too, but people are not answering, so I figured that it might be more appropriate here. I'm not sure if I'm adding a designer to my code properly. I'm only adding it to the tree node, where each custom tree node is then added to a normal tree control
I'm trying to get an add-in to interact with the property window in VS.Net. Basically, I created a tool window containing a custom tree...
|
by: cpnet |
last post by:
I've authored a custom web component (a non-ui component kinda like a
DataSet) and so far it's working. When my web component is added to the web
form in the designer from the toolbox, the namespace for my component is
automatically added to the using directive of the codebehind. And, the
appropriate assembly is added to the "References" for the Web form's
project.
However, my custom component has a field (initialized to null, and...
|
by: Sanjay Pais |
last post by:
I am using .NET 2005 Beta 2.
I need to create a custom property for a text box like this. My custom
property is called ApplySecurity.
<asp:TextBox ID="txtTextBox1" ApplySecurity="True"
runat="server"></asp:TextBox>
|
by: Adam J. Schaff |
last post by:
Hello. I have a custom collection that implements IBindingList (allownew and
allowremove are both true). I have bound it to a datagrid. I have add and
remove buttons on the screen. I want to implement those buttons, but I'm not
sure what the code should look like.
I tried what I thought was obvious code:
myCollection.AddNew()
and
| |
by: AMDRIT |
last post by:
Hello everyone,
I have created a custom component and one of its properties is a class
object with it's own properties. During runtime, I can assign values to the
class object properties just fine. However, when attempting to assing
default values as designtime in the propertygrid, nothing is working on the
class object. I know that I am doing it wrong, any ideas what it is?
Thanks in advance
|
by: asnowfall |
last post by:
I am creating MailMessage out of already existing email message.
My existing message has few custom properties. I wan to add them to
System.Net.Mail.MailMessage
How to add custom properties?
I was thinking adding custom properties to
System.Net.Mail.MailMessage.Headers. but it's a READONLY property.
System.Net.Mail.MailMessage has few header fields as properties (eg:
FROM, TO, CC) and these are not sufficient.
|
by: |
last post by:
I have made some user controls with custom properties. I can set those
properties on instances of my user controls, and I have programmed my user
control to do useful visual things in response to how those properties are
set.
I want to be able to do two other things:
a) add User control instances to my page, filling in the place of
placeholder controls, and
b) programmatically setting custom properties on those dynamically spawned...
|
by: asharda |
last post by:
I have a custom property grid. I am using custom property grid as I do
not want the error messages that the propertygrid shows when abphabets
are entered in interger fields.
The custom property grid doesn't show colloections i.e. if I have a
List<Objectthen the Collection is shown but when I click on the
"..." button next to it nothing comes up.
If I say CustomPropertyGrid p = new CustomPropertyGrid();
p.SelectedObject = new...
|
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
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 captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
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 into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
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
| |
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |