473,699 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2760
Have you tried throwing an ArgumentExcepti on 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******** ******@TK2MSFTN GP10.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? ArgumentExcepti on?
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 ArgumentExcepti on 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******** *****@TK2MSFTNG P10.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 ArgumentExcepti on 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
13591
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? Thanks! Schema: <?xml version="1.0"?> <xs:schema id="ReportInfo" targetNamespace="http://tempuri.org/Reports.xsd"
1
297
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 src property in various standard ASP.NET controls Is there anyway for me to link my custom property into this standard dialog box Thanks for any advice
2
1172
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 called "Text" that sets and getis it value, as follows: public string Text
2
1040
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
4282
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 be able to double-click the flow node and open a pre-built modal dialog box that sets the node's properties, rather than jump into the code-beside window. Jon
1
5073
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 began getting the "Enter Parameter Value" dialog and it was asking for the query by its name "sel_report_data" whenever I tried to run or preview the report. To troubleshoot the problem, I selected the query in the database window, hit the "New...
2
5623
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 and be replaced by another one (represeneting the smae BMP but focused/or selected). where can i find some tutorial or basic steps about that ?
2
4223
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 which use a custom property editor. when this property editor is not linked to this property,
2
1780
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 property, why? Could anybody help me ? thanks ctlA.cs ----------------------------
0
8685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8612
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,...
0
9032
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 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...
1
8905
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8880
tracyyun
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...
1
6532
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 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...
0
4373
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...
0
4625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2342
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.