Click here to Skip to main content
15,895,011 members
Home / Discussions / C#
   

C#

 
GeneralMultiline text not displayed correctly in text box Pin
Luis Alonso Ramos16-Oct-04 12:38
Luis Alonso Ramos16-Oct-04 12:38 
GeneralRe: Multiline text not displayed correctly in text box Pin
Heath Stewart16-Oct-04 21:09
protectorHeath Stewart16-Oct-04 21:09 
GeneralRe: Multiline text not displayed correctly in text box Pin
Luis Alonso Ramos16-Oct-04 21:23
Luis Alonso Ramos16-Oct-04 21:23 
GeneralRe: Multiline text not displayed correctly in text box Pin
Heath Stewart16-Oct-04 21:31
protectorHeath Stewart16-Oct-04 21:31 
GeneralRe: Multiline text not displayed correctly in text box Pin
Luis Alonso Ramos16-Oct-04 21:58
Luis Alonso Ramos16-Oct-04 21:58 
GeneralRe: Multiline text not displayed correctly in text box Pin
Heath Stewart16-Oct-04 22:13
protectorHeath Stewart16-Oct-04 22:13 
GeneralNo validation events when clicking on a toolbar Pin
Luis Alonso Ramos16-Oct-04 12:33
Luis Alonso Ramos16-Oct-04 12:33 
GeneralRe: No validation events when clicking on a toolbar Pin
Alex Korchemniy16-Oct-04 15:01
Alex Korchemniy16-Oct-04 15:01 
Make sure CausesValidation is set to true.

If you have a custom control that was implemented differently you can force validation. My company used the following code in some of our projects:

public class Tasks
{
	public static void ForceControlValidation(Control c)
	{
		Type t = typeof(Control);

		// validate:
		MethodInfo m = t.GetMethod("NotifyValidating", BindingFlags.Instance | BindingFlags.InvokeMethod | BindingFlags.NonPublic);
		object obj = m.Invoke(c, new object[0]);

		// finish validating
		if (obj is bool && (bool)obj == false)
		{
			MethodInfo m2 = t.GetMethod("NotifyValidated", BindingFlags.Instance | BindingFlags.InvokeMethod | BindingFlags.NonPublic);
			m2.Invoke(c, new object[0]);
		}
	}
}


Does anyone have something that works better? Please let me know.

This posting is provided "AS IS" with no warranties, and confers no rights.

Alex Korchemniy
GeneralRe: No validation events when clicking on a toolbar Pin
Luis Alonso Ramos16-Oct-04 15:49
Luis Alonso Ramos16-Oct-04 15:49 
GeneralRe: No validation events when clicking on a toolbar Pin
Heath Stewart16-Oct-04 20:58
protectorHeath Stewart16-Oct-04 20:58 
GeneralRe: No validation events when clicking on a toolbar Pin
Luis Alonso Ramos16-Oct-04 22:07
Luis Alonso Ramos16-Oct-04 22:07 
GeneralRe: No validation events when clicking on a toolbar Pin
Luis Alonso Ramos18-Oct-04 14:02
Luis Alonso Ramos18-Oct-04 14:02 
GeneralRe: No validation events when clicking on a toolbar Pin
Heath Stewart18-Oct-04 14:04
protectorHeath Stewart18-Oct-04 14:04 
GeneralRe: No validation events when clicking on a toolbar Pin
Luis Alonso Ramos18-Oct-04 14:23
Luis Alonso Ramos18-Oct-04 14:23 
GeneralRe: No validation events when clicking on a toolbar Pin
Heath Stewart18-Oct-04 16:08
protectorHeath Stewart18-Oct-04 16:08 
GeneralRe: No validation events when clicking on a toolbar Pin
Luis Alonso Ramos19-Oct-04 6:03
Luis Alonso Ramos19-Oct-04 6:03 
GeneralRe: No validation events when clicking on a toolbar Pin
Heath Stewart19-Oct-04 7:14
protectorHeath Stewart19-Oct-04 7:14 
GeneralRe: No validation events when clicking on a toolbar Pin
Luis Alonso Ramos19-Oct-04 7:39
Luis Alonso Ramos19-Oct-04 7:39 
GeneralGetting active MdiChild Pin
Luis Alonso Ramos16-Oct-04 12:29
Luis Alonso Ramos16-Oct-04 12:29 
GeneralRe: Getting active MdiChild Pin
Alex Korchemniy16-Oct-04 14:45
Alex Korchemniy16-Oct-04 14:45 
GeneralRe: Getting active MdiChild Pin
Luis Alonso Ramos16-Oct-04 15:17
Luis Alonso Ramos16-Oct-04 15:17 
Generalsearch mechanism Pin
mathon16-Oct-04 9:56
mathon16-Oct-04 9:56 
GeneralRe: search mechanism Pin
Alex Korchemniy16-Oct-04 11:15
Alex Korchemniy16-Oct-04 11:15 
GeneralRe: search mechanism Pin
mathon16-Oct-04 13:06
mathon16-Oct-04 13:06 
GeneralRe: search mechanism Pin
Alex Korchemniy16-Oct-04 14:36
Alex Korchemniy16-Oct-04 14:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.