Windows有没有提供带CheckBox的MessageBox?(50分)

  • 主题发起人 主题发起人 com
  • 开始时间 开始时间
C

com

Unregistered / Unconfirmed
GUEST, unregistred user!
我是说Windows的,不要说自己做一个,那样的化我就不问了。
 
肯定没有,因为它不够通用。
 
试试<br>procedure TForm1.Button1Click(Sender: TObject); <br>Var <br>&nbsp; AMsgDialog: TForm; <br>&nbsp; ACheckBox: TCheckBox; <br>begin <br>&nbsp; AMsgDialog := CreateMessageDialog('This is a test message.', mtWarning, [mbYes, mbNo]); <br>&nbsp; ACheckBox := TCheckBox.Create(AMsgDialog); <br>&nbsp; with AMsgDialog do <br>&nbsp; try <br>&nbsp; &nbsp; Caption := 'Dialog Title' ; <br>&nbsp; &nbsp; Height := 169; <br><br>&nbsp; &nbsp; With ACheckBox do <br>&nbsp; &nbsp; begin <br>&nbsp; &nbsp; &nbsp; Parent := AMsgDialog; <br>&nbsp; &nbsp; &nbsp; Caption := 'Don''t show me again.'; <br>&nbsp; &nbsp; &nbsp; top := 121; <br>&nbsp; &nbsp; &nbsp; Left := 8; <br>&nbsp; &nbsp; end; <br><br>&nbsp; &nbsp; Case ShowModal of <br>&nbsp; &nbsp; &nbsp; ID_YES: ;//your code here after dialog closed <br>&nbsp; &nbsp; &nbsp; ID_NO: &nbsp;; <br>&nbsp; &nbsp; end; <br>&nbsp; &nbsp; If ACheckBox.Checked then <br>&nbsp; &nbsp; begin <br>&nbsp; &nbsp; &nbsp; //... <br>&nbsp; &nbsp; end; <br>&nbsp; finally <br>&nbsp; &nbsp; ACheckBox.Free; <br>&nbsp; &nbsp; Free; <br>&nbsp; end; <br>end; <br>
 
So many code!
 
凑合了,呵呵[8D]
 
后退
顶部