Control-I deletes selected text in DBRichView
Posted: Wed Feb 02, 2011 7:41 am
I am using the one of the demos. Whn I select text and press Ctrl-I it deletes the selected word. I want to use Control-I to get italics. I've tempoarily set it up to use Ctrl-K to do italics. Any idea why Ctrl-I deletes the selected text? Underline and Bold work great.
// shortcuts for Bold, Underline and Italic
if ( ActiveControl = rve ) then
begin
// Bold
if ( (ssCtrl in Shift) and ( key = ord('B')) ) then
begin
// simulate button press
if btnBold.Down = False then
btnBold.Down := True
else
btnBold.Down := False ;
rve.ApplyStyleConversion(1); // bold tag
end ;
// italics
if ( (ssCtrl in Shift) and ( key = ord('K')) ) then
begin
// simulate button press
if btnItalic.Down = False then
btnItalic.Down := True
else
btnItalic.Down := False ;
rve.ApplyStyleConversion(2); // italics tag
end ;
// underline
if ( (ssCtrl in Shift) and ( key = ord('U')) ) then
begin
// simulate button press
if btnUnderline.Down = False then
btnUnderline.Down := True
else
btnUnderline.Down := False ;
rve.ApplyStyleConversion(3); // italics tag
end ;
// shortcuts for Bold, Underline and Italic
if ( ActiveControl = rve ) then
begin
// Bold
if ( (ssCtrl in Shift) and ( key = ord('B')) ) then
begin
// simulate button press
if btnBold.Down = False then
btnBold.Down := True
else
btnBold.Down := False ;
rve.ApplyStyleConversion(1); // bold tag
end ;
// italics
if ( (ssCtrl in Shift) and ( key = ord('K')) ) then
begin
// simulate button press
if btnItalic.Down = False then
btnItalic.Down := True
else
btnItalic.Down := False ;
rve.ApplyStyleConversion(2); // italics tag
end ;
// underline
if ( (ssCtrl in Shift) and ( key = ord('U')) ) then
begin
// simulate button press
if btnUnderline.Down = False then
btnUnderline.Down := True
else
btnUnderline.Down := False ;
rve.ApplyStyleConversion(3); // italics tag
end ;
Code: Select all