Click here to Skip to main content
15,922,894 members
Home / Discussions / C#
   

C#

 
GeneralRe: Java class to C#: inheritance problem Pin
cabo15-May-03 9:32
cabo15-May-03 9:32 
Generalreqaurding rtf boxes Pin
jtmtv1814-May-03 22:57
jtmtv1814-May-03 22:57 
GeneralRe: reqaurding rtf boxes Pin
KingTermite15-May-03 3:35
KingTermite15-May-03 3:35 
GeneralRe: reqaurding rtf boxes Pin
jtmtv1815-May-03 10:11
jtmtv1815-May-03 10:11 
GeneralRe: reqaurding rtf boxes Pin
KingTermite16-May-03 2:41
KingTermite16-May-03 2:41 
GeneralRe: reqaurding rtf boxes Pin
jtmtv1816-May-03 8:19
jtmtv1816-May-03 8:19 
GeneralRe: reqaurding rtf boxes Pin
KingTermite16-May-03 12:59
KingTermite16-May-03 12:59 
GeneralRe: reqaurding rtf boxes Pin
jtmtv1816-May-03 14:00
jtmtv1816-May-03 14:00 
Well i got the code to work perfectly...but perhaps you could help me optimize it ? it is incredibly unefficent....because it moves char by char...and each time it changes the font / color of that char it has to update the hole rtf box. if i could find away to do all this work in memory...the speed increase would be incredible. The following code seems to work good....but any ideas on how i can perform the same actions in memory?

int iIndex = 0;<br />
				int SelSt = GetMainFormData.MainTextArea.SelectionStart;<br />
				Color[] jr = new Color[GetMainFormData.MainTextArea.SelectedText.Length];<br />
				Font[] fr = new Font[GetMainFormData.MainTextArea.SelectedText.Length];<br />
				//<br />
				//MessageBox.Show(GetMainFormData.MainTextArea.SelectionStart.ToString());<br />
				//<br />
				int tmp = GetMainFormData.MainTextArea.SelectionLength;<br />
				GetMainFormData.MainTextArea.Visible = false;<br />
				while ( iIndex < (tmp) )<br />
				{<br />
					// Go one char at a time<br />
					GetMainFormData.MainTextArea.Select(SelSt,1);<br />
					if (null != GetMainFormData.MainTextArea.SelectionFont)<br />
					{	<br />
						fr[iIndex] = GetMainFormData.MainTextArea.SelectionFont;<br />
						Font tmpF = (Font)fr[iIndex];<br />
						if(tmpF == fd.Font)<br />
						{<br />
							GetMainFormData.MainTextArea.SelectionFont = fd.Font;<br />
						}<br />
						else if(tmpF != fd.Font)<br />
						{<br />
							Font fonf = new Font(tmpF.FontFamily,fd.Font.Size,fd.Font.Style);<br />
							<br />
							GetMainFormData.MainTextArea.SelectionFont = fonf;<br />
						}<br />
					}<br />
					if (true != GetMainFormData.MainTextArea.SelectionColor.IsEmpty)<br />
					{<br />
						jr[iIndex] = GetMainFormData.MainTextArea.SelectionColor;<br />
						GetMainFormData.MainTextArea.SelectionColor = jr[iIndex];<br />
					}<br />
					SelSt++;<br />
					iIndex++;<br />
				}


Jesse M
GeneralHiWord/LoWord/etc in C# Pin
J. Dunlap14-May-03 19:33
J. Dunlap14-May-03 19:33 
GeneralRe: HiWord/LoWord/etc in C# Pin
cdehelean15-May-03 4:49
cdehelean15-May-03 4:49 
GeneralRe: HiWord/LoWord/etc in C# Pin
J. Dunlap15-May-03 7:37
J. Dunlap15-May-03 7:37 
GeneralHandling ActiveX control events in .Net Pin
Anonymous14-May-03 18:21
Anonymous14-May-03 18:21 
QuestionEquiv of DrawState() API in .NET? Pin
J. Dunlap14-May-03 12:21
J. Dunlap14-May-03 12:21 
AnswerRe: Equiv of DrawState() API in .NET? Pin
James T. Johnson14-May-03 14:06
James T. Johnson14-May-03 14:06 
GeneralRe: Equiv of DrawState() API in .NET? Pin
J. Dunlap14-May-03 14:12
J. Dunlap14-May-03 14:12 
GeneralRe: Equiv of DrawState() API in .NET? Pin
James T. Johnson14-May-03 14:16
James T. Johnson14-May-03 14:16 
GeneralRe: Equiv of DrawState() API in .NET? Pin
J. Dunlap14-May-03 14:42
J. Dunlap14-May-03 14:42 
GeneralRe: Equiv of DrawState() API in .NET? Pin
J. Dunlap14-May-03 20:37
J. Dunlap14-May-03 20:37 
GeneralPlease, tell me WebServices are not stupid! Pin
Daniel Turini14-May-03 11:28
Daniel Turini14-May-03 11:28 
GeneralRe: Please, tell me WebServices are not stupid! Pin
leppie14-May-03 12:15
leppie14-May-03 12:15 
GeneralRe: Please, tell me WebServices are not stupid! Pin
James T. Johnson14-May-03 13:53
James T. Johnson14-May-03 13:53 
GeneralPass byte[] -> struct Pin
Wizard_0114-May-03 10:33
Wizard_0114-May-03 10:33 
GeneralRe: Pass byte[] -> struct Pin
Richard Deeming15-May-03 8:45
mveRichard Deeming15-May-03 8:45 
GeneralPicture Control Issues Pin
RB@Emphasys14-May-03 9:36
RB@Emphasys14-May-03 9:36 
GeneralRe: Picture Control Issues Pin
leppie14-May-03 9:41
leppie14-May-03 9:41 

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.