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

ErrorProvider problem

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 problem happens when I use the
show method of the child form it will try to validate the first field and
since it need to not empty and its just opening for the first time it fails
and the errorprovider shows an error icon, something that I obviously dont
want since the user hasnt done anything wrong yet. any Ideas?

Thanks in advanced.
Alvaro
Nov 21 '05 #1
5 1643
Alvaro,

Did you use the "getfocus" event instead of the "validating" event in the
MDI form. It sounds like that.

However I think you need to show some "sample" code how you did it.

I hope this helps

Cor
Nov 21 '05 #2
Well I did use validating here is the code where I create the child form:

Dim FormInstance As MyForm

FormInstance = New MyForm(ks_FormType.ks_Adding)

FormInstance.MdiParent = Me

FormInstance.Show()

FormInstance = Nothing

Here is the code where I use the error provider to validate:

Private Sub Name_Validating(ByVal sender As Object, ByVal e As
System.ComponentModel.CancelEventArgs) Handles Name.Validating

If IsNothing(Me.Name.Text) Or (Me.Name.Text = "") Then

Me.epPuesto.SetError(Me.txtNombre, "ERROR MESSAGE")

e.Cancel = True

Else

Me.epPuesto.SetError(Me.txtNombre, "")

e.Cancel = False

End If

End Sub

I have basically the same code in all the rest of the controls in that form.
One thing I did notice is that in a dialog that I call upon with the same
validation scheme doesn't produce the same error and the only diference that
I can see is that said dialog isn't a child of the main program form.

Alvaro, again thanks in advanced.

"Cor Ligthert" <no************@planet.nl> escribió en el mensaje
news:OR**************@TK2MSFTNGP09.phx.gbl...
Alvaro,

Did you use the "getfocus" event instead of the "validating" event in the
MDI form. It sounds like that.

However I think you need to show some "sample" code how you did it.

I hope this helps

Cor

Nov 21 '05 #3
Alvaro,

It seems to me that MyForm is not a standard form, however an inherited
form. So answering withouth to know that, and as well what you are doing
with that, makes it in my opinion not simple.

Better to say what does that member in MyForm?

Cor
Nov 21 '05 #4
It is a standard form, it just has a modified constructor to know who is
calling it and for what reason. the wierd thing is that another form that I
open that I am not making a child of the mdi parent and that I call upon
using the showdialog method instead of the show method, in this case the
problem doesnt arrise.
"Cor Ligthert" <no************@planet.nl> escribió en el mensaje
news:Oo*************@TK2MSFTNGP09.phx.gbl...
Alvaro,

It seems to me that MyForm is not a standard form, however an inherited
form. So answering withouth to know that, and as well what you are doing
with that, makes it in my opinion not simple.

Better to say what does that member in MyForm?

Cor

Nov 21 '05 #5
Alvaro,

I have answered you on this in your other thread.

Cor
Nov 21 '05 #6

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....
0
by: Dan K. | last post by:
Hi NG, the problem : im working with the error provider (EP) to remind users of filling required fields. in each control i ve a check method which check the field inputs and set if needed the...
1
by: OShell77 | last post by:
Hi, I have problem with a C# Win Forms app that uses the ErrorProvider class to provide input validation feedback to the user. On my development workstation (WinXP Pro + Visual Studio .NET...
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...
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...
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...
4
by: csharpula csharp | last post by:
Hello, I am using ErrorProvider for PropertyGrid control and in case of error I am doing the following: SetError(grdInfo, _msgError); The problem is the the icon is shown near the...
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: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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...
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...

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.