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

Point like designer

Question when I'm using property of Point (or Size) type in User Control. In
design time while adding the control you can edit X,Y each one.
I want to create my own struct like point to be able to appears as point in
designer. In my case I can see only ReadOnly "10x10" in Properties view
while adding this user control
Following the example:

[DefaultValue(typeof(Dimension),"16x16"), Category("Design"),

Description("Dimension Value"),

Editor (typeof(Dimension),typeof(System.Drawing.Design.UI TypeEditor))]

public Dimension Size {get{return m_size;} set{m_size=value;}}

-----------------------

public struct Dimension

{

int m_inputs;

public int Inputs{get{return m_inputs;}set{m_inputs=value;}}

int m_outputs;

public int Outputs{get{return m_outputs;}set{m_outputs=value;}}

public Dimension(int inputs, int outputs)

{

m_inputs=inputs;

m_outputs = outputs;

}

public override string ToString()

{

return Inputs.ToString()+"x"+Outputs.ToString();

}

}
Please assist

--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "
Nov 16 '05 #1
3 1000
Hi Tamir,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need that your own type can be
displayed as Size or Point in property window which can be expanded. If
there is any misunderstanding, please feel free to let me know.

As far as I know, we need to derive from TypeConverter class and implement
CanConvertFrom, ConvertFrom and ConvertTo in the this type. Here is an
article talking about this in detail. HTH.

http://msdn.microsoft.com/library/de...us/dndotnet/ht
ml/vsnetpropbrow.asp

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #2
Thank you . That's exacly what I need ;)

--
Tamir Khason
You want dot.NET? Just ask:
"Please, www.dotnet.us "

"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:cE**************@cpmsftngxa06.phx.gbl...
Hi Tamir,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need that your own type can be
displayed as Size or Point in property window which can be expanded. If
there is any misunderstanding, please feel free to let me know.

As far as I know, we need to derive from TypeConverter class and implement
CanConvertFrom, ConvertFrom and ConvertTo in the this type. Here is an
article talking about this in detail. HTH.

http://msdn.microsoft.com/library/de...us/dndotnet/ht
ml/vsnetpropbrow.asp

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #3
Hi Tamir,

You're welcome. Thanks for sharing your experience with all the people
here. If you have any questions, please feel free to post them in the
community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #4

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

Similar topics

687
by: cody | last post by:
no this is no trollposting and please don't get it wrong but iam very curious why people still use C instead of other languages especially C++. i heard people say C++ is slower than C but i can't...
4
by: Hai Nguyen | last post by:
I'm learning C sharp and do not like vb much. I'm creatiing a wepage using panel to test myself. I tried to use these code below, which is written in VB, and to transform them to c sharp but I got...
19
by: Dales | last post by:
I have a custom control that builds what we refer to as "Formlets" around some content in a page. These are basically content "wrapper" sections that are tables that have a colored header and...
4
by: Dave Taylor | last post by:
I've been using the dataset designer in Visual Studio to create typed datasets for my application by dragging over tables from the Server Explorer and dropping them into the designer. The problem...
3
by: Tin Gherdanarra | last post by:
A colleague gave me a project where there was a /designer/ window for database connectivity (drag&drop from the toolbox), but I can't find out how to get a /designer/ window in my own project....
13
by: cj | last post by:
In a project done in 2003 about a year ago I was told to add the SocketWrench code below into the Windows Form Designer generated code area as shown below. #Region " Windows Form Designer...
2
by: dejavue82 | last post by:
Does anybody know how to resolve the following errors? They were caused by the designer.cs file that was auto-generated by the LINQ to SQL designer. I am using the March 2007 Orcas CTP version of...
4
by: Goran Djuranovic | last post by:
Hi all, I am experiencing a strange thing happening with a "designer.vb" page. Controls I manually declare in this page are automatically deleted after I drop another control on a ".aspx" page. -...
6
by: Cirene | last post by:
Does VS 2008 have a good XML designer to work with XML data, schemas, etc...? Any tools to easily add, edit and delete data from an XML file? This is new to me.... Thanks!
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
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,...
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,...
0
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...
0
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,...
0
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...

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.