wmpaint

trying to change the color of some stuff in a memo.

Using wmpaint does what I want, it shows the text in a diffrent color, but if I write in new text it comes out in standard color (black), and if I select my colored text and deselect it it reverts to black color.

TMyMemo=class(TMemo)
private
proc wmpaint()
end;

proc wmpaint;begin;end;

(shortened of course ;) ).
Will still show and appears to redraw the text if the text is selected..

Comments

  • : trying to change the color of some stuff in a memo.
    :
    : Using wmpaint does what I want, it shows the text in a diffrent color, but if I write in new text it comes out in standard color (black), and if I select my colored text and deselect it it reverts to black color.
    :
    : TMyMemo=class(TMemo)
    : private
    : proc wmpaint()
    : end;
    :
    : proc wmpaint;begin;end;
    :
    : (shortened of course ;) ).
    : Will still show and appears to redraw the text if the text is selected..
    :
    Is it not easier to change the color of the font?
  • : : trying to change the color of some stuff in a memo.
    : :
    : : Using wmpaint does what I want, it shows the text in a diffrent color, but if I write in new text it comes out in standard color (black), and if I select my colored text and deselect it it reverts to black color.
    : :
    : : TMyMemo=class(TMemo)
    : : private
    : : proc wmpaint()
    : : end;
    : :
    : : proc wmpaint;begin;end;
    : :
    : : (shortened of course ;) ).
    : : Will still show and appears to redraw the text if the text is selected..
    : :
    : Is it not easier to change the color of the font?
    :

    can't do that with wmpaint, I can of course change to richedit, but.. it pissed me off that this didn't work ;)

    I'v gotten my suspicion confirmed though, it's not my code that has the problem it's delphi.
  • : : : trying to change the color of some stuff in a memo.
    : : :
    : : : Using wmpaint does what I want, it shows the text in a diffrent color, but if I write in new text it comes out in standard color (black), and if I select my colored text and deselect it it reverts to black color.
    : : :
    : : : TMyMemo=class(TMemo)
    : : : private
    : : : proc wmpaint()
    : : : end;
    : : :
    : : : proc wmpaint;begin;end;
    : : :
    : : : (shortened of course ;) ).
    : : : Will still show and appears to redraw the text if the text is selected..
    : : :
    : : Is it not easier to change the color of the font?
    : :
    :
    : can't do that with wmpaint, I can of course change to richedit, but.. it pissed me off that this didn't work ;)
    :
    : I'v gotten my suspicion confirmed though, it's not my code that has the problem it's delphi.
    :
    I thought you wanted to change the color of the entire text, and not some part of it. You can use the TRichEdit to change the color of a part of the text. You first need to select the part you want to change, and then select the font color.
  • : : : : trying to change the color of some stuff in a memo.
    : : : :
    : : : : Using wmpaint does what I want, it shows the text in a diffrent color, but if I write in new text it comes out in standard color (black), and if I select my colored text and deselect it it reverts to black color.
    : : : :
    : : : : TMyMemo=class(TMemo)
    : : : : private
    : : : : proc wmpaint()
    : : : : end;
    : : : :
    : : : : proc wmpaint;begin;end;
    : : : :
    : : : : (shortened of course ;) ).
    : : : : Will still show and appears to redraw the text if the text is selected..
    : : : :
    : : : Is it not easier to change the color of the font?
    : : :
    : :
    : : can't do that with wmpaint, I can of course change to richedit, but.. it pissed me off that this didn't work ;)
    : :
    : : I'v gotten my suspicion confirmed though, it's not my code that has the problem it's delphi.
    : :
    : I thought you wanted to change the color of the entire text, and not some part of it. You can use the TRichEdit to change the color of a part of the text. You first need to select the part you want to change, and then select the font color.
    :


    Actualy, I wanna change the text and the background color (but only in the text area), and richview can't do that, I could do that if I could get my overriding wmpaint to work properly though.

  • : Actualy, I wanna change the text and the background color (but only in the text area), and richview can't do that, I could do that if I could get my overriding wmpaint to work properly though.

    I tried doing that awhile ago when I tried to write a GUI application with a console window embedded in it. I ended up writing my own component, which wasnt really all that hard so maybe you could look into that.

    If you arent comfortable with that, there are plenty of other free components out there. One of them was written by Danny Thorpe, who is one of the guys who works on Delphi/Kylix so I would recommend it. Just search for Console on www.torry.net and you can't miss it.
  • : : Actualy, I wanna change the text and the background color (but only in the text area), and richview can't do that, I could do that if I could get my overriding wmpaint to work properly though.
    :
    : I tried doing that awhile ago when I tried to write a GUI application with a console window embedded in it. I ended up writing my own component, which wasnt really all that hard so maybe you could look into that.
    :
    : If you arent comfortable with that, there are plenty of other free components out there. One of them was written by Danny Thorpe, who is one of the guys who works on Delphi/Kylix so I would recommend it. Just search for Console on www.torry.net and you can't miss it.
    :

    Making my own is what I'm working with already, I still wonder why it doesen't work though :/

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories