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

ErrorProviders - Icon Change at Run-Time


My user interface design requires that ErrorProviders are used for errors
but also to indicate warnings to the users as well. In order to provide a
clear visual clue between errors and warnings its necessary to have two
differing icons.

I could place two ErrorProviders on my form, but what I would really like to
do is switch the Icon on the ErrorProvider control at run-time. But I am
having difficulty in understanding the syntax required to point the
ErrorProvider icon property at an Icon embedded inside the project assembly.

Does anybody have an suggestions on the syntax required to achieve this?

Many thanks

Steve Le Monnier

Nov 17 '05 #1
2 5889
Steve Le Monnier wrote:

My user interface design requires that ErrorProviders are used for errors
but also to indicate warnings to the users as well. In order to provide a
clear visual clue between errors and warnings its necessary to have two
differing icons.

I could place two ErrorProviders on my form, but what I would really like
to do is switch the Icon on the ErrorProvider control at run-time. But I
am having difficulty in understanding the syntax required to point the
ErrorProvider icon property at an Icon embedded inside the project
assembly.

Does anybody have an suggestions on the syntax required to achieve this?


This MS knowledge base article should have all the information you need:
http://support.microsoft.com/Default.aspx?id=319292

However, I have done the same thing in the past and I've found it more
practicable to use two different error providers - not so much switching
code, and the code is easier to understand because it's plain to see what
provider is used in a specific error/warning situation.
Oliver Sturm
--
Expert programming and consulting services available
See http://www.sturmnet.org (try /blog as well)
Nov 17 '05 #2
Thanks for the advice Oliver I will do some additional tests before deciding
what to do.

FYI: My post was a simplification of what I am trying to achieve. I'm not
dragging the ErrorProviders onto a form I am actually embedding them
directly inside my own TextBox control, that's the reason why I don't want
to overload the control with four versions of the error provider when I know
only one can ever be active at any one time.

By having ErrorProviders built into a textbox control I can centralise some
of the standard data validation I do on every single project I work on. This
should allow me to reduce the amount of form validation code I end up
writing.

Cheers

Steve Le Monnier

"Oliver Sturm" <ol****@sturmnet.org> wrote in message
news:xn****************@msnews.microsoft.com...
Steve Le Monnier wrote:

My user interface design requires that ErrorProviders are used for errors
but also to indicate warnings to the users as well. In order to provide a
clear visual clue between errors and warnings its necessary to have two
differing icons.

I could place two ErrorProviders on my form, but what I would really like
to do is switch the Icon on the ErrorProvider control at run-time. But I
am having difficulty in understanding the syntax required to point the
ErrorProvider icon property at an Icon embedded inside the project
assembly.

Does anybody have an suggestions on the syntax required to achieve this?


This MS knowledge base article should have all the information you need:
http://support.microsoft.com/Default.aspx?id=319292

However, I have done the same thing in the past and I've found it more
practicable to use two different error providers - not so much switching
code, and the code is easier to understand because it's plain to see what
provider is used in a specific error/warning situation.
Oliver Sturm
--
Expert programming and consulting services available
See http://www.sturmnet.org (try /blog as well)

Nov 17 '05 #3

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

Similar topics

2
by: Jack | last post by:
Hello, <%@ Language=VBScript %> <% Response.Write "<SELECT id=select1 name=select1 method=GET>" Response.Write "<OPTION 1>One</OPTION>" Response.Write "<OPTION 2>Two</OPTION>" Response.Write...
4
by: Roy | last post by:
Maybe I am in the wrong place and doing this the wrong way... please tell me if you think there is a better way. I need to transfer some files from a server to the client workstation. The...
2
by: Vic | last post by:
I am trying to change an icon associated with my application's main form and the application itself. 1. I selected my main form in IDE "Solution" tab and went to "Properties" window. 2. I found...
8
by: Adrian | last post by:
How do I put an icon on a form using code? Thank you.
0
by: TWPAL | last post by:
Hello, There is an app that I would like to monitor. When it finishes its work, the only thing that changes is the icon in the system tray (think red/green light). I've been sending...
0
by: Steve | last post by:
After installing my application (which I developed using Visual Studio 2005) on a target desktop, the desktop icon shows the icon that is assigned to the application exe - which is what I want. ...
2
by: fasttrack | last post by:
Hello, I have a problem, I have built a vb.net application and deployed. Everything is OK and functioning. But I need a thing: I have to run a vb.net file .exe at the end of setup and...
2
by: Chaz Ginger | last post by:
I have a need for the minimal Linux system to run Python. Basically I want the system to boot up and instead of starting up Init/etc. I would love it to run python (and a python script I have...
4
by: Benjamin Hell | last post by:
Hi! I wonder whether there might be a way to find out how a Python program was started (in my case in Windows): By double clicking the file or by calling it on the "DOS" command line prompt. ...
2
by: bahnfire | last post by:
Hi, I am hoping that I finally have the right group :-) I am using Visual C++ Express 2008 and am trying to change the taskbar icon that I am using (notifyIcon1) as some state changes (button...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: 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.