473,225 Members | 1,340 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,225 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 1387
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...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.