Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Design Time / November 2005

Tip: Looking for answers? Try searching our database.

A custom IntegerUITypeEditor

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Carlo - 04 Nov 2005 13:15 GMT
Hello all,

assume I have this code:

 <Editor(GetType(Editors.IntegerUITypeEditor),
GetType(System.Drawing.Design.UITypeEditor))> _
 Public Property MyIntegerValue() As Integer
   '...
 End Property

This means that I have my own personalized IntegerUITypeEditor that inherits
from UITypeEditor.

Now, instead, assume I have the following code:

 <RangeAttribute(0,360), Editor(GetType(Editors.IntegerUITypeEditor),
GetType(System.Drawing.Design.UITypeEditor))> _
 Public Property MyIntegerValue() As Integer
   '...
 End Property

This means that I have a personalized numeric editor (IntegerUITypeEditor)
AND a personalized attribute (RangeAttribute) that just holds a min and a
max value.

The question is: how can I read, from within IntegerUITypeEditor the values
(min and max) of a RangeAttribute when are both associated to the same
property?

Thank you

Carlo

-------------------------------------------
Carlo, MCP (Windows Based Applications)
carlodevREMOVE@gmail.com
Atul - 10 Nov 2005 13:32 GMT
The EditValue method of your IntegerUITypeEditor will be passed a
ITypeDescriptorContext object. Use the PropertyDescriptor property and then
the Attributes property to get to the RangeAtrribute.

----------------
-Atul, Sky Software http://www.ssware.com
Shell MegaPack For .Net & ActiveX
Windows Explorer GUI Controls
 &
Quick-Launch Like Appbars, MSN/Office2003 Style Popups,
System Tray Icons and Shortcuts/Internet Shortcuts
----------------

> Hello all,
>
[quoted text clipped - 32 lines]
> Carlo, MCP (Windows Based Applications)
> carlodevREMOVE@gmail.com
Carlo - 11 Nov 2005 08:15 GMT
Hi Atul
thank you for your suggestion. It seems to be very useful to me. I'm going
to try right now.
Thank you once more.
Carlo

-------------------------------------------
Carlo, MCP (Windows Based Applications)
carlodevREMOVE@gmail.com

> The EditValue method of your IntegerUITypeEditor will be passed a
> ITypeDescriptorContext object. Use the PropertyDescriptor property and
[quoted text clipped - 45 lines]
>> Carlo, MCP (Windows Based Applications)
>> carlodevREMOVE@gmail.com

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.