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

Getting reference to an ErrorProvider

J L
I have a from with an ErrorProvider on it. I pass a reference of the
form to a subroutine where I want to reference the ErorrProvider. I
could pass it in the call to the subroutine, but I would like to
dreive it from the reference to the form that I am already passing.

Can this be done?

TIA
John

Nov 21 '05 #1
3 1390
Hi John,

Sure it can. In your form create a new public property which returns the
instance of your ErrorProvider:

---
Public ReadOnly Property GetErrProvider
Get
Return _errorProvider ' or whatever you named the control
End Get
End Property
---

Regards,
-Adam.

J L wrote:
I have a from with an ErrorProvider on it. I pass a reference of the
form to a subroutine where I want to reference the ErorrProvider. I
could pass it in the call to the subroutine, but I would like to
dreive it from the reference to the form that I am already passing.

Can this be done?

TIA
John

Nov 21 '05 #2
J L
Hi Adam,
Thanks for the tip. Since I have several forms that I need to
"discover" their errorprovider, I was hoping to find a way to do it
like using a For Each loop. But error providers do not show up in the
control collection and I tried components and that did not seem to
work. So if worse comes to worse, I will have to creat a property as
you suggest. Thanks for your input!

John

On Sat, 09 Apr 2005 16:47:46 +0930, Adam Goossens
<ad**********@users.sourceforge.net> wrote:
Hi John,

Sure it can. In your form create a new public property which returns the
instance of your ErrorProvider:

---
Public ReadOnly Property GetErrProvider
Get
Return _errorProvider ' or whatever you named the control
End Get
End Property
---

Regards,
-Adam.

J L wrote:
I have a from with an ErrorProvider on it. I pass a reference of the
form to a subroutine where I want to reference the ErorrProvider. I
could pass it in the call to the subroutine, but I would like to
dreive it from the reference to the form that I am already passing.

Can this be done?

TIA
John


Nov 21 '05 #3
John,

Yeah, error providers appear to be strange little things and sit "over"
your form rather than as a part of it (eg, inside the Controls or
Components collections).

I can't think of any other (simple) solution other than implementing a
property. You might consider deriving all of your forms from a common
base class and placing your error provider and accessor property in there.

Good luck,
-Adam.

J L wrote:
Hi Adam,
Thanks for the tip. Since I have several forms that I need to
"discover" their errorprovider, I was hoping to find a way to do it
like using a For Each loop. But error providers do not show up in the
control collection and I tried components and that did not seem to
work. So if worse comes to worse, I will have to creat a property as
you suggest. Thanks for your input!

John

Nov 21 '05 #4

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

Similar topics

3
by: Martijn Leine | last post by:
I am using an errorprovider and a datagrid component on a form. I use the errorprovider to display error hints in the grid, in the case the entered data by the user is checked and not found Ok....
6
by: M O J O | last post by:
Hi, How do I check if an ErrorProvider has errors? Take for example this code... (err = ErrorProvider...) Public Sub Test If TextBox1.Text= "" Then
0
by: Issac | last post by:
Hi, I am writing a program which will be used in Win2000 and Win98 platform. The program include a Form (called myForm) which has a TextBox, Tooltip, Errorprovider and a Button. Tooltip...
3
by: Jeppe Jespersen | last post by:
I read the following - regarding the ErrorProvider control - in the MOC Course Material for course 2373: "You can set your own error messages manually, as shown in the following example, or when...
2
by: Lenster | last post by:
I'm having problems using the errorprovider in VB.NET to automatically display an error icon next to textboxes bound to the same dataset as the errorprovider. The sequence of events is : ...
4
by: ljlevend | last post by:
I have the following issues: 1. I want to make it so that ToolTips never go away once they are shown until the user moves the mouse outside of the control for which the ToolTip is assigned. It...
5
by: Alvaro Lamas | last post by:
I have a problem with the ErrorProvider with a mdi interface, I have a MDI form which opens a child form, that child form uses the errorprovider to show the problems with the data entry. The...
4
by: Freeon | last post by:
How do I capture the hover event on the ErrorProvider control? I created a custom control and inherited the ErrorProvider. Problem is I don't know which method to override to capture the hover...
2
by: Dad | last post by:
Hi, There does not appear to be anywhere for ErrorProvider to display its icon for ListView, ToolStrip, and other other control set with dockstyle fill, top, or bottom does not leave space to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...

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.