Thanks Carlos for your reply.


Jijesh 


Date: Thu, 11 Jun 2009 18:40:16 +0200
Subject: Re: [Mono-winforms-list] Issues with Control focus and error provider 
location
From: [email protected]
To: [email protected]
CC: [email protected]

We have implemented this feature, but it's only available in the trunk version, 
and will be available in the next 2.6 release as well.

Carlos.


2009/6/9 Jijesh <[email protected]>


Hi Friends,

I have a dataentry application developed in C# winforms. In that, most of
the testbox fields are validated using conditions and error providers. When
i tried the application in ubuntu using mono, the validations are not
working. In actual situation the focus should not go from the control if the
validation fails. but the focus goes off in this scenario.

Please look into the sample code i wrote for this scenario to test. Here i
have two text boxes in a group box and one error provider. The textbox entry
is validating on the "textBox1_Validating" event handler.

public partial class Form1 : Form
á á{
á á á áprivate System.Windows.Forms.TextBox textBox1;
á á á áprivate System.Windows.Forms.Button button1;
á á á áprivate System.Windows.Forms.ErrorProvider errorProvider1;
á á á áprivate System.Windows.Forms.GroupBox groupBox1;
á á á áprivate System.Windows.Forms.TextBox textBox2;

á á á ápublic Form1()
á á á á{
á á á á á áInitializeComponent();
á á á á}

á á á áprivate void textBox1_Validating(object sender, CancelEventArgs e)
á á á á{
á á á á á áif (textBox1.Text != "")
á á á á á á{
á á á á á á á átry
á á á á á á á á{
á á á á á á á á á áDateTime validatedate =
Convert.ToDateTime(textBox1.Text.Trim());
á á á á á á á á á áif (validatedate.Year < 1900)
á á á á á á á á á á{

á á á á á á á á á á á áMessageBox.Show("Enter a valid Date");
á á á á á á á á á á á átextBox1.Focus();
á á á á á á á á á á á áreturn;
á á á á á á á á á á}
á á á á á á á á á áelse
á á á á á á á á á á á áerrorProvider1.SetError(textBox1, "");
á á á á á á á á}
á á á á á á á ácatch
á á á á á á á á{

á á á á á á á á á áerrorProvider1.SetError(textBox1, "Enter a valid Date");
á á á á á á á á á átextBox1.Focus();
á á á á á á á á}
á á á á á á}
á á á á á áelse
á á á á á á á áerrorProvider1.SetError(textBox1, "");
á á á á}

á á á áprivate void textBox2_Validating(object sender, CancelEventArgs e)
á á á á{
á á á á á áif (textBox2.Text != "")
á á á á á á{
á á á á á á á átry
á á á á á á á á{
á á á á á á á á á áDateTime validatedate =
Convert.ToDateTime(textBox2.Text.Trim());
á á á á á á á á á áif (validatedate.Year < 1900)
á á á á á á á á á á{

á á á á á á á á á á á áerrorProvider1.SetError(textBox2, "Enter a valid
Date2");

á á á á á á á á á á á átextBox2.Focus();
á á á á á á á á á á á áreturn;
á á á á á á á á á á}
á á á á á á á á á áelse
á á á á á á á á á á á áerrorProvider1.SetError(textBox2, "");
á á á á á á á á}
á á á á á á á ácatch
á á á á á á á á{

á á á á á á á á á áerrorProvider1.SetError(textBox2, "Enter a valid
Date2");
á á á á á á á á á átextBox2.Focus();
á á á á á á á á}
á á á á á á}
á á á á á áelse
á á á á á á á áerrorProvider1.SetError(textBox2, "");
á á á á}


á á á á á á á áHere the focus is not staying back on the control if the
validation fails and,error provider is not shown at the correct position.


Thanks in advance,
Jijesh



--
View this message in context: 
http://www.nabble.com/Issues-with-Control-focus-and-error-provider-location-tp23939522p23939522.html
Sent from the Mono - WinForms mailing list archive at Nabble.com.

_______________________________________________
Mono-winforms-list maillist á- á[email protected]
http://lists.ximian.com/mailman/listinfo/mono-winforms-list


_________________________________________________________________
Windows Live™ SkyDrive™: Get 25 GB of free online storage.
http://windowslive.com/online/skydrive?ocid=TXT_TAGLM_WL_SD_25GB_062009
_______________________________________________
Mono-winforms-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-winforms-list

Reply via email to