|
먼저 첫번째 질문은 아래의 구문을 쓰면
오른쪽화살표를 누르면 리치에디트상에 있던 글자가
커서가 지나가면서 빨간색으로 바뀌는 건데요
이게 바뀌기는 하는데 화면이 껌벅거리네요...
이거 어케 잡나요?
글구 두번째 질문은 아래에 왼쪽 화살표를 누르면 글짜가
녹색으로 변하는 건데요...
이건 잘 않되네요...
글구 마지막으로
리치에디트를 Disable시킨상태에서
키를 눌러 색깔을 바꾸려고 하는데
포커스를 다른놈이 가지고 있네요....
이 땐 어찌하나요?
누가 아시는 분좀 없나요?
void __fastcall TForm1::RichEdit1KeyDown(TObject *Sender, WORD &Key,
TShiftState Shift)
{
int bak_x;
int cur_x;
String sText;
if (Key == VK_RIGHT)
{
bak_x = RichEdit1->SelStart;
RichEdit1->SelStart++;
cur_x = RichEdit1->SelStart;
RichEdit1->SelStart = bak_x;
RichEdit1->SelLength = cur_x - bak_x;
RichEdit1->SelAttributes->Color = clRed;
RichEdit1->SelLength = 1;
}
if (Key == VK_LEFT)
{
bak_x = RichEdit1->SelStart;
if(bak_x != 0)
RichEdit1->SelStart--;
cur_x = RichEdit1->SelStart;
RichEdit1->SelStart = cur_x;
RichEdit1->SelLength = cur_x - bak_x;
RichEdit1->SelAttributes->Color = clGreen;
RichEdit1->SelLength = 0;
}
}
|