掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
ウィンドウの「閉じる」ボタンの×マークの出し方 (ID:42079)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
かなり適当ですが、formにTImageとTButtonを貼り付けて試して下さい。 コードはXE2で書いてますのでそれ以前だとコンパイルが通らないかと思います。 とりあえずNormal状態で書いてますが他にもHot状態やPush状態、無効状態があるようです。(twCloseButtonNormal, twCloseButtonHot, twCloseButtonPushed, twCloseButtonDisabled) procedure TForm1.Button2Click(Sender: TObject); var Bmp: TBitmap; Detail: TThemedElementDetails; OuterRect: TRect; ButtonRect :Trect; begin if StyleServices.Available then begin Bmp := TBitmap.Create; Bmp.Width := Image1.Width; Bmp.Height := Image1.Height; OuterRect := Rect(0, 0, 32, 32); Detail := StyleServices.GetElementDetails(twCloseButtonNormal); if Not StyleServices.GetElementContentRect(Bmp.Canvas.Handle, Detail, OuterRect, ButtonRect) then ButtonRect := Rect(0 , 0, 0, 0); StyleServices.DrawElement(Bmp.Canvas.Handle, Detail, ButtonRect); Image1.Picture.Assign(Bmp); FreeAndNil(Bmp); end; end;
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.