Board index » delphi » Replace List Box and Combo Box buttons and sliders

Replace List Box and Combo Box buttons and sliders

Hello,

I would like to know if there are any procedures, with examples, of how
to change the button graphics for sliders and combo box down arrows?

Any and all help for D1 and D3 would be greatly appreciated.

Thanks

Barry

 

Re:Replace List Box and Combo Box buttons and sliders


The "graphic" used for these is in the Marlett truetype font keys 5 and 6
or t and u.
Get a font editing program and edit the font...

The font is hidden int he fonts directory... Be sure to make a copy...

Barry J. Watt <bw...@desktopfx.com> wrote in message
news:39C68976.E7185924@desktopfx.com...

Quote
> Hello,

> I would like to know if there are any procedures, with examples, of how
> to change the button graphics for sliders and combo box down arrows?

> Any and all help for D1 and D3 would be greatly appreciated.

> Thanks

> Barry

Re:Replace List Box and Combo Box buttons and sliders


I guess I wasn't clear about what I was looking for... I want to place custom
graphics in the scroll bar to replace the grey buttons and grey slider
background. I understand that it has something to do with the WMPaint
messages... but no luck in finding it elsewhere...

Barry

Quote
MrBaseball34 wrote:
> The "graphic" used for these is in the Marlett truetype font keys 5 and 6
> or t and u.
> Get a font editing program and edit the font...

> The font is hidden int he fonts directory... Be sure to make a copy...

> Barry J. Watt <bw...@desktopfx.com> wrote in message
> news:39C68976.E7185924@desktopfx.com...
> > Hello,

> > I would like to know if there are any procedures, with examples, of how
> > to change the button graphics for sliders and combo box down arrows?

> > Any and all help for D1 and D3 would be greatly appreciated.

> > Thanks

> > Barry

Re:Replace List Box and Combo Box buttons and sliders


It would be in either the WM_NCPAINT handler of the scrollbar or
one the WM_CTLCOLORXXX messages...

You can change the color of the background of the scrollbar using
the WM_CTLCOLORSCROLLBAR message but I'm not sure about
the buttons and the one on the combobox is probably handled by the
WM_CTLCOLORBUTTON...

Quote
> I guess I wasn't clear about what I was looking for... I want to place custom
> graphics in the scroll bar to replace the grey buttons and grey slider
> background. I understand that it has something to do with the WMPaint
> messages... but no luck in finding it elsewhere...

> Barry

> MrBaseball34 wrote:

> > The "graphic" used for these is in the Marlett truetype font keys 5 and 6
> > or t and u.
> > Get a font editing program and edit the font...

> > The font is hidden int he fonts directory... Be sure to make a copy...

> > > I would like to know if there are any procedures, with examples, of how
> > > to change the button graphics for sliders and combo box down arrows?

> > > Any and all help for D1 and D3 would be greatly appreciated.

Re:Replace List Box and Combo Box buttons and sliders


I think you'll have to create a custom component (acustom combobox, a custom
listbox, etc) And then override the Paint procedure. Heres is what you do
(I'm sure it work from D4 and up, i'm not sure about earlier versions):

Select File-New-Component from de menu. Choose the Class you want to inherit
from; if you want to make a comboBox inherit from TCustomComboBox, not
TComboBox (the same for TCustomListBox and so on).

Choose a cool name for your component. Example TCoolBomboBox

Click Ok. Save Everything in a new directory.

now, in the protected part of the TCoolComboCox declaration add the
following;

 Procedure Paint; override;

and implement the function like this

procedure TCoolComboBox.Paint;
begin
  inherited;
  {Do anything with the canvas here... like  Canvas.FillRect(5,7,45,56)
   or something}
end;

Canvas is the "urface" of the control, you can paint lines, circles,
bitmaps, etc. Look for the TCanvas help

Other Threads