473,388 Members | 1,834 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,388 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 2731
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...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
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...
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
jinu1996
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...

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.