Click here to Skip to main content
15,891,184 members
Home / Discussions / C#
   

C#

 
AnswerRe: Hex to binary? Pin
Christian Graus22-Feb-07 22:26
protectorChristian Graus22-Feb-07 22:26 
QuestionThere is finish painting event? Pin
aukh22-Feb-07 21:17
aukh22-Feb-07 21:17 
AnswerRe: There is finish painting event? Pin
Christian Graus22-Feb-07 23:39
protectorChristian Graus22-Feb-07 23:39 
AnswerRe: There is finish painting event? Pin
Luc Pattyn23-Feb-07 10:20
sitebuilderLuc Pattyn23-Feb-07 10:20 
Generaltextbox cairrage return Pin
V.22-Feb-07 21:01
professionalV.22-Feb-07 21:01 
GeneralRe: textbox cairrage return Pin
Christian Graus22-Feb-07 23:57
protectorChristian Graus22-Feb-07 23:57 
GeneralRe: textbox cairrage return Pin
V.23-Feb-07 0:19
professionalV.23-Feb-07 0:19 
GeneralRe: textbox cairrage return Pin
Martin#23-Feb-07 0:08
Martin#23-Feb-07 0:08 
Hello,

Did this just for fun, because you made me curious about that problem.
I only made a quick test, so maybe there are some bugs.

using System;

namespace WindowsApplication1
{
	public class ValidatingTextBox : System.Windows.Forms.TextBox
	{
		private bool			BlockTextChanged = false;
		private const string	EnterString = @"\r\n";

		public ValidatingTextBox()
		{
		}

		protected override void OnTextChanged(EventArgs e)
		{
			if(!BlockTextChanged)
			{
				BlockTextChanged = true;
				if(this.Text != string.Empty)
				{
					for(int x = Text.IndexOf(EnterString,0); x<this.Text.Length && x>-1; x = Text.IndexOf(EnterString,x))
					{
						SendEnterAtIndex(x);
					}
				}
				BlockTextChanged = false;
			}
			base.OnTextChanged(e);
		}

		private void SendEnterAtIndex(int index)
		{
			this.Text = this.Text.Remove(index, EnterString.Length);
			this.SelectionStart = index;
			this.Text = this.Text.Insert(index, System.Environment.NewLine);	
		}
	}
}




All the best,

Martin
GeneralRe: textbox cairrage return Pin
V.23-Feb-07 0:22
professionalV.23-Feb-07 0:22 
QuestionSet StandardClick/StandardDoubleClick to a ListView control Pin
blackjack215022-Feb-07 21:01
blackjack215022-Feb-07 21:01 
QuestionXSL Variable in .cs File Pin
Abubakarsb22-Feb-07 20:56
Abubakarsb22-Feb-07 20:56 
AnswerRe: XSL Variable in .cs File Pin
Stefan Troschuetz22-Feb-07 22:22
Stefan Troschuetz22-Feb-07 22:22 
GeneralRe: XSL Variable in .cs File Pin
Abubakarsb22-Feb-07 23:51
Abubakarsb22-Feb-07 23:51 
GeneralRe: XSL Variable in .cs File Pin
Abubakarsb22-Feb-07 23:52
Abubakarsb22-Feb-07 23:52 
GeneralRe: XSL Variable in .cs File Pin
Stefan Troschuetz23-Feb-07 0:04
Stefan Troschuetz23-Feb-07 0:04 
GeneralRe: XSL Variable in .cs File Pin
Abubakarsb23-Feb-07 0:11
Abubakarsb23-Feb-07 0:11 
GeneralRe: XSL Variable in .cs File Pin
Stefan Troschuetz23-Feb-07 0:22
Stefan Troschuetz23-Feb-07 0:22 
GeneralRe: XSL Variable in .cs File Pin
Abubakarsb23-Feb-07 0:11
Abubakarsb23-Feb-07 0:11 
GeneralRe: XSL Variable in .cs File Pin
Stefan Troschuetz23-Feb-07 0:24
Stefan Troschuetz23-Feb-07 0:24 
GeneralRe: XSL Variable in .cs File Pin
Abubakarsb23-Feb-07 0:26
Abubakarsb23-Feb-07 0:26 
GeneralRe: XSL Variable in .cs File Pin
Stefan Troschuetz23-Feb-07 0:32
Stefan Troschuetz23-Feb-07 0:32 
QuestionFetch last record of table Pin
Nekshan22-Feb-07 20:08
Nekshan22-Feb-07 20:08 
AnswerRe: Fetch last record of table Pin
il_masacratore22-Feb-07 21:23
il_masacratore22-Feb-07 21:23 
AnswerRe: Fetch last record of table Pin
althamda22-Feb-07 22:27
althamda22-Feb-07 22:27 
AnswerRe: Fetch last record of table Pin
virendra patel23-Feb-07 16:37
virendra patel23-Feb-07 16:37 

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.