Click here to Skip to main content
15,896,153 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: How do I compile a bootable program? Pin
led mike12-May-08 4:17
led mike12-May-08 4:17 
QuestionRe: How do I compile a bootable program? Pin
H1He215-May-08 6:26
H1He215-May-08 6:26 
Questionhelp on exe generation from other exe Pin
alex7869-May-08 4:54
alex7869-May-08 4:54 
AnswerDouble Post - Please Ignore Pin
Giorgi Dalakishvili9-May-08 5:26
mentorGiorgi Dalakishvili9-May-08 5:26 
QuestionGet names of all devices in system Pin
Xeqtr9-May-08 0:53
Xeqtr9-May-08 0:53 
QuestionCreateWaitableTimer error Pin
Member 33310598-May-08 19:47
Member 33310598-May-08 19:47 
AnswerRe: CreateWaitableTimer error Pin
Mark Salsbery9-May-08 7:53
Mark Salsbery9-May-08 7:53 
Questioncolor change Pin
rose1968-May-08 19:34
rose1968-May-08 19:34 
Hai

I am trying to change the color of a word, while typing itself, for that i wrote the code as follows.

private: System::Void keypressevent(System::Object^ sender, System::Windows::Forms::KeyPressEventArgs^ e)
{
array<String^>^ keyword = gcnew array<String^>{"#include","#define","struct"};
int length = keyword->Length;
String ^ strRTF = this->richTextBox1->Rtf;
this->richTextBox1->Clear();
int iCTableStart = strRTF->IndexOf("colortbl;");
if (iCTableStart != -1)
{
int iCTableEnd = strRTF->IndexOf('}', iCTableStart);
strRTF = strRTF->Remove(iCTableStart, iCTableEnd - iCTableStart);
strRTF = strRTF->Insert(iCTableStart,
"colortbl ;\\red255\\green0\\blue0;\\red0\\green128\\blue0;\\red0\\green0\\blue255;}");
}
else
{
int iRTFLoc = strRTF->IndexOf("\\rtf");
int iInsertLoc = strRTF->IndexOf('{', iRTFLoc);
if (iInsertLoc == -1) iInsertLoc = strRTF->IndexOf('}', iRTFLoc) - 1;
strRTF = strRTF->Insert(iInsertLoc,
"{\\colortbl ;\\red128\\green0\\blue0;\\red0\\green128\\blue0;\\red0\\green0\\blue255;}");
}
int len = strRTF->Length;
String^ tempst;
String^ result;
String ^key;
int keylen;
int iRTFLoc;
bool found = false;
bool starcomment = true;
int nlen = strRTF->Length;
for(int nchRTF = 0;nchRTF < nlen;nchRTF++)
{
if(strRTF[nchRTF] == ' ')
{
for(int nkeyword = 0;nkeyword<length;nkeyword++)
{
key = keyword[nkeyword];
keylen = key->Length;
iRTFLoc = tempst->IndexOf(keyword[nkeyword]);
if(tempst == key)
{
found = true;
break;
}
}
if(found)
{
if(starcomment)
{
int location = 4+iRTFLoc+keylen+1;
tempst = tempst->Insert( iRTFLoc,"\\cf3 ");
tempst = tempst->Insert( location,"\\cf0 ");
}
found = false;
}
tempst = String::Concat(tempst, strRTF[nchRTF]);
result = String::Concat(result,tempst);
tempst = String::Empty;
}
else
{
tempst = String::Concat(tempst,strRTF[nchRTF] );
}
}
result = String::Concat(result,tempst);
tempst = String::Empty;
this->richTextBox1->Rtf = result;
}


Now my problem is when i am typing the code in the richtextbox it will be displayed like "diov" instead of "void". I

i think its cursor position problem. can you tell me how to recover this.
AnswerRe: color change Pin
Mark Salsbery9-May-08 8:03
Mark Salsbery9-May-08 8:03 
QuestionError Laoding Assembly Pin
kkchh8-May-08 5:09
kkchh8-May-08 5:09 
Questionsend Packet to all computer with synchronized Pin
dSolariuM6-May-08 19:50
dSolariuM6-May-08 19:50 
QuestionHow to Convert Local time to UTC Time in WM5.0 Pin
Mohanraj D6-May-08 0:05
Mohanraj D6-May-08 0:05 
AnswerRe: How to Convert Local time to UTC Time in WM5.0 Pin
Rajesh R Subramanian6-May-08 0:24
professionalRajesh R Subramanian6-May-08 0:24 
Questioncursor position Pin
rose1965-May-08 19:37
rose1965-May-08 19:37 
AnswerRe: cursor position Pin
led mike6-May-08 4:23
led mike6-May-08 4:23 
GeneralRe: cursor position Pin
rose1966-May-08 19:01
rose1966-May-08 19:01 
GeneralRe: cursor position Pin
Mark Salsbery7-May-08 8:47
Mark Salsbery7-May-08 8:47 
QuestionArguments to command line Pin
Xeqtr4-May-08 12:44
Xeqtr4-May-08 12:44 
AnswerRe: Arguments to command line Pin
Luc Pattyn4-May-08 12:53
sitebuilderLuc Pattyn4-May-08 12:53 
GeneralRe: Arguments to command line Pin
Xeqtr4-May-08 13:30
Xeqtr4-May-08 13:30 
GeneralRe: Arguments to command line Pin
Luc Pattyn4-May-08 13:36
sitebuilderLuc Pattyn4-May-08 13:36 
GeneralRe: Arguments to command line [modified] Pin
Xeqtr4-May-08 14:13
Xeqtr4-May-08 14:13 
GeneralRe: Arguments to command line Pin
Luc Pattyn4-May-08 14:26
sitebuilderLuc Pattyn4-May-08 14:26 
QuestionHow to develop virtual environment online using C# with Managed DirectX? Pin
katelva3-May-08 8:20
katelva3-May-08 8:20 
AnswerRe: How to develop virtual environment online using C# with Managed DirectX? Pin
Mark Salsbery3-May-08 8:33
Mark Salsbery3-May-08 8:33 

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.