How do I change the title of ColorDialog?

后端 未结 4 723
北荒
北荒 2021-01-19 14:21

I\'m spinning up a ColorDialog component in WinForms to let the user select a particular custom control\'s chart\'s background color and foreground color. Both configuratio

4条回答
  •  终归单人心
    2021-01-19 14:59

    I'm posting this in case others come across this in years to come.

    Using the SetWindowText() function in the OnShow() event works fine. I'm not sure which version of Delphi introduced TColorDialog.OnShow but it goes at least back to XE2.

    procedure TForm1.ColorDialog1Show(Sender: TObject);
      begin
      SetWindowText(ColorDialog1.Handle, MyTitle);
      end;
    

    For my purposes I use a global variable for MyTitle and assign the appropriate text before calling ColorDialog1.Execute.

提交回复
热议问题