473,383 Members | 1,795 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,383 software developers and data experts.

Custom control "invalid property value" dialog

Hi, ive written a custom control and i would like to display the
"invalid property value" dialog box for certain properties on my form if
the user enters a value outside the allowed range (in the visual studio
designer).
e.g. If i had a percentage property, i would want the user only to be
able to enter Int32 values between 0&100. How can i do this?
Jan 18 '06 #1
5 2730
Have you tried throwing an ArgumentException in your property setter?

Mar
Jan 18 '06 #2
Mark,

If your property throw an exception the designer will show the Invalid
property value withe the exception message.
--

Stoitcho Goutsev (100)

"Mark Ingram" <no****@nowhere.com> wrote in message
news:es**************@TK2MSFTNGP10.phx.gbl...
Hi, ive written a custom control and i would like to display the "invalid
property value" dialog box for certain properties on my form if the user
enters a value outside the allowed range (in the visual studio designer).
e.g. If i had a percentage property, i would want the user only to be able
to enter Int32 values between 0&100. How can i do this?

Jan 18 '06 #3
Stoitcho Goutsev (100) wrote:
Mark,

If your property throw an exception the designer will show the Invalid
property value withe the exception message.

which exception? ArgumentException?
Jan 18 '06 #4
Stoitcho Goutsev (100) wrote:
Mark,

If your property throw an exception the designer will show the Invalid
property value withe the exception message.


Throwing an Exception and ArgumentException both worked great, thanks!
Jan 18 '06 #5
Doesn't matter what kind of exception you throws, whatever make sense in you
case.

--

Stoitcho Goutsev (100)

"Mark Ingram" <no****@nowhere.com> wrote in message
news:uZ*************@TK2MSFTNGP10.phx.gbl...
Stoitcho Goutsev (100) wrote:
Mark,

If your property throw an exception the designer will show the Invalid
property value withe the exception message.


Throwing an Exception and ArgumentException both worked great, thanks!

Jan 18 '06 #6

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

Similar topics

6
by: TS | last post by:
Hi, i have a problem validating xml against schema. I used http://apps.gotdotnet.com/xmltools/xsdvalidator/Default.aspx validator and it says it is fine. Can you tell me why this doesn't work? ...
1
by: Eldon Ferran de Pol | last post by:
Hi all I've got a custom control that has several image based properties I wan't each of these properties to use the standard .Net dialog box for selecting a URL that appears when setting the...
2
by: Earl Teigrob | last post by:
I have a custom control that creates a textarea child control and diplays it to the user. The control is defined as follows System.Web.UI.HtmlControls.HtmlTextArea TextArea1; I have a property...
2
by: nrflores | last post by:
I have both vs.net 2003 & vs.net 2005 Proffesional installed. Now I can't open the DataGrid property dialog in vs.net 2003 using vb.net. It is not there anymore. Any help??
6
by: Jon Davis | last post by:
Is it possible to have a custom dialog for setting the properties of a custom WF activity? For example, in the designer, if you drag-and-drop a custom control onto the flow chart, I would like to...
1
by: waltnixon | last post by:
I've got an MS Access query which runs fine when double clicked and returns all of the rows in a test database I'm building. I've set up a multi group report based on the query. I immediately...
2
by: R.A.F. | last post by:
Hi, I would like to create a custom property editor for Alignment. This property editor should open a small form where are 9 small BMPs. when user select by clicking 1 BMP, the bmp should change...
2
by: R.A.F. | last post by:
Hi, I have a custom control in which i have a collection property named "Columns". this collection property add/remove column objects. in my Column class i have a property named Alignment...
2
by: Brook | last post by:
In webform.aspx: <cc:ctlB ID="ctl1" runat="server" Width="200px" /> If set value to width property, I will get a error that say ctlB.Page is null. This control will be fine with no width...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.