Click here to Skip to main content
15,907,225 members
Home / Discussions / C#
   

C#

 
AnswerRe: annoying null problems Pin
PlayByTheRules26-Oct-06 5:55
PlayByTheRules26-Oct-06 5:55 
GeneralRe: annoying null problems Pin
gus_br26-Oct-06 6:15
gus_br26-Oct-06 6:15 
AnswerRe: annoying null problems Pin
Keith Barrow26-Oct-06 7:01
professionalKeith Barrow26-Oct-06 7:01 
QuestionVS2005 - ReferencePaths Pin
AJ12326-Oct-06 4:45
AJ12326-Oct-06 4:45 
AnswerRe: VS2005 - ReferencePaths Pin
gus_br26-Oct-06 5:00
gus_br26-Oct-06 5:00 
QuestionRichTextBox.Text is formated in HTML [modified] Pin
1010210626-Oct-06 4:23
1010210626-Oct-06 4:23 
AnswerRe: RichTextBox.Text is formated in HTML Pin
Wolf9226-Oct-06 4:27
Wolf9226-Oct-06 4:27 
AnswerRe: RichTextBox.Text is formated in HTML Pin
ednrgc26-Oct-06 4:36
ednrgc26-Oct-06 4:36 
I've used this in the past:

<pre> public string ToHTML(RichTextBox Box)
{
string sReturn;
long lColour;
bool bBold;
bool bItalic;
string sFont;
long lSize;
long lOldSelStart;
long lOldSelLength;
long a;

//Initial box setup
{
lOldSelStart = Box.SelStart;
lOldSelLength = Box.SelLength;
Box.SelStart = 0;
Box.SelLength = 1;
}

//Initial text
sReturn = "<html>";

//Inital paramaters
lColour = Box.SelColor;
bBold = Box.SelBold;
bItalic = Box.SelItalic;
sFont = Box.SelFontName;
lSize = Box.SelFontSize;

//Initial font setup
sReturn = sReturn + "<font size=\"" + Box.SelFontSize + "\" face=\"" + Box.SelFontName + "\" color=\"" + Box.SelColor + "\">";

//Initial bold setup
if (Box.SelBold == true)
{
sReturn = sReturn + "<b>";
}

//Initial italic setup
if (Box.SelItalic == true)
{
sReturn = sReturn + "<i>";
}

//Append new character
sReturn = sReturn + Strings.Mid(Box.Text, 1, 1);

for (a = 2; a <= Strings.Len(Box.Text); a++) {
//Set up reading paramater
{
Box.SelStart = a - 1;
Box.SelLength = 1;
}
//Check for updated font tage
if (Box.SelColor != lColour | Box.SelFontName != sFont | Conversion.Int(Box.SelFontSize) != lSize)
{
sReturn = sReturn + "</font><font size=\"" + Box.SelFontSize + "\" face=\"" + Box.SelFontName + "\" color=\"" + Box.SelColor + "\">";
}
//Check for changed boldness
if (Box.SelBold != bBold)
{
if (Box.SelBold == false)
{
sReturn = sReturn + "</b>";
}
else
{
sReturn = sReturn + "<b>";
}
}
//Check for changed italics
if (Box.SelItalic != bItalic)
{
if (Box.SelItalic == false)
{
sReturn = sReturn + "</i>";
}
else
{
sReturn = sReturn + "<i>";
}
}
sReturn = sReturn + Strings.Mid(Box.Text, a, 1);
//Update paramaters
lColour = Box.SelColor;
bBold = Box.SelBold;
bItalic = Box.SelItalic;
sFont = Box.SelFontName;
lSize = Box.SelFontSize;
}

//Check ending bold and italic
if (bBold == true) sReturn = sReturn + "</b>";
if (bItalic == true) sReturn = sReturn + "</i>";

//Terminate HTML
sReturn = sReturn + "</font></html>";

//Restore box values
{
Box.SelStart = lOldSelStart;
Box.SelLength = lOldSelLength;
}
return sReturn;
//Return value
}
</pre>
QuestionFile is copying Pin
C-Scharbe26-Oct-06 4:20
C-Scharbe26-Oct-06 4:20 
AnswerRe: File is copying Pin
Rob Philpott26-Oct-06 4:34
Rob Philpott26-Oct-06 4:34 
GeneralRe: File is copying Pin
C-Scharbe26-Oct-06 4:40
C-Scharbe26-Oct-06 4:40 
GeneralRe: File is copying Pin
The Man from U.N.C.L.E.26-Oct-06 6:38
The Man from U.N.C.L.E.26-Oct-06 6:38 
GeneralRe: File is copying Pin
Aby Thomas Varghese26-Oct-06 8:22
Aby Thomas Varghese26-Oct-06 8:22 
GeneralRe: File is copying Pin
C-Scharbe26-Oct-06 20:16
C-Scharbe26-Oct-06 20:16 
QuestionCharacter "space" in a textbox -- same space used for upper and lower case? Pin
shultas26-Oct-06 3:53
shultas26-Oct-06 3:53 
AnswerRe: Character "space" in a textbox -- same space used for upper and lower case? Pin
shultas26-Oct-06 3:54
shultas26-Oct-06 3:54 
GeneralRe: Character "space" in a textbox -- same space used for upper and lower case? Pin
Muntyness26-Oct-06 4:06
Muntyness26-Oct-06 4:06 
GeneralRe: Character "space" in a textbox -- same space used for upper and lower case? Pin
shultas26-Oct-06 4:11
shultas26-Oct-06 4:11 
GeneralRe: Character "space" in a textbox -- same space used for upper and lower case? Pin
Pete O'Hanlon26-Oct-06 4:22
mvePete O'Hanlon26-Oct-06 4:22 
GeneralRe: Character "space" in a textbox -- same space used for upper and lower case? Pin
Eric Dahlvang26-Oct-06 5:36
Eric Dahlvang26-Oct-06 5:36 
Questionstring method Pin
rzvme26-Oct-06 3:52
rzvme26-Oct-06 3:52 
AnswerRe: string method Pin
shultas26-Oct-06 4:05
shultas26-Oct-06 4:05 
GeneralRe: string method Pin
rzvme26-Oct-06 8:54
rzvme26-Oct-06 8:54 
QuestionWhich is better? (Communications between classes) Pin
Muntyness26-Oct-06 3:42
Muntyness26-Oct-06 3:42 
AnswerRe: Which is better? (Communications between classes) Pin
Guffa26-Oct-06 4:11
Guffa26-Oct-06 4:11 

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.