๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
2 messages
2 total messages Started by ScOe Tue, 11 Mar 2003 18:14
Few Memo control questions
#17474
Author: ScOe
Date: Tue, 11 Mar 2003 18:14
16 lines
1670 bytes
I'm working on nfo editor application ... For those who have made their own
.nfo's, something like AcidDraw
So in general ... I'm using Memo control which i made read only. I'm
catching VK_SPACE key event
on which i change Memo1->SelText to selected char.
Initialy i've put 40 lines of 80 ' ' chars that forms initial border.
I dont want to exceed border limits (width).
Problem is in VK_BACK .. if overwrite is turned on i use this:
        Memo1->SelStart --;
        Memo1->SelLength = 1;
        Memo1->SelText = ' ';
        Memo1->SelStart --;
but if not .. i need to clear previous char and in same time change place of
following chars and add one blank at the end of line ...
Other question is: Can i catch Function F1-12 key's with OnKeyPress event of
Memo control ?
Re: Few Memo control questions
#17471
Author: Asger J๏ฟฝrgensen
Date: Tue, 11 Mar 2003 18:50
20 lines
1452 bytes
Hi ScOe

  In article <3e6e2772@newsgroups.borland.com>,  ScOe says :

> Problem is in VK_BACK .. if overwrite is turned on i use this:
>         Memo1->SelStart --;
>         Memo1->SelLength = 1;
>         Memo1->SelText = ' ';
>         Memo1->SelStart --;

You should not use -- and ++ on properties since they have 
no return values You can be sure that it will work.
You have to do like this:

Memo1->SelStart = Memo1->SelStart - 1;
You might also need to check if the value is less then 0
or higher then text length.

Best regards
Asger
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads