Board index » delphi » MessageBox + checkbox
mARCELO
![]() Delphi Developer |
mARCELO
![]() Delphi Developer |
MessageBox + checkbox2004-07-22 05:16:11 AM delphi2 Would be something like a question, and a checkbox like "Donīt ask me anymore". Any components or ways of be doing this? thanks in advance. Marcelo |
Finn Tolderlund
![]() Delphi Developer |
2004-07-22 05:25:36 AM
Re:MessageBox + checkbox
A form with a checkbox?
Or is that too simple? :-) -- Finn Tolderlund "mARCELO" <XXXX@XXXXX.COM>skrev i en meddelelse QuoteWould be something like a question, and a checkbox like "Donīt ask me |
Martin Kammann
![]() Delphi Developer |
2004-07-22 05:25:38 AM
Re:MessageBox + checkboxQuoteWould be something like a question, and a checkbox like "Donīt ask me Martin web: www.autag.com blog: softwarenitpick.blogspot.com |
Aleksey Kuznetsov
![]() Delphi Developer |
2004-07-22 08:11:15 AM
Re:MessageBox + checkbox
Usually such questions asked at "delphi.thirdpartytools.general" NG, and
there is plently or components/libraries with such dialog box. For example, one at the AppControls pack (www.appcontrols.com). Regards, Aleksey QuoteWould be something like a question, and a checkbox like "Donīt ask me |
Pavel Vozenilek
![]() Delphi Developer |
2004-07-22 04:14:27 PM
Re:MessageBox + checkbox
"mARCELO" <XXXX@XXXXX.COM>writes:
QuoteWould be something like a question, and a checkbox like "Donīt ask me /Pavel |
mARCELO
![]() Delphi Developer |
2004-07-22 09:10:04 PM
Re:MessageBox + checkbox
how can i get the result of the userīs choice using acInfoBox
? "Aleksey Kuznetsov" <XXXX@XXXXX.COM>escreveu na mensagem QuoteUsually such questions asked at "delphi.thirdpartytools.general" NG, and |
Bernhard Geyer
![]() Delphi Developer |
2004-07-22 09:35:10 PM
Re:MessageBox + checkbox
Elpack (www.ceberus.com/lmd/products/lmdelpack/) have such Dialog
(TElPromptDialog) "mARCELO" <XXXX@XXXXX.COM>schrieb im Newsbeitrag QuoteWould be something like a question, and a checkbox like "Donīt ask me |
steve-o
![]() Delphi Developer |
2004-07-22 09:36:14 PM
Re:MessageBox + checkbox
"mARCELO" <XXXX@XXXXX.COM>writes
QuoteWould be something like a question, and a checkbox like "Donīt ask me to wrap into some kind of dialog component. There's probably a better way to do this, but here is a quik and dirty way to get this accomplished... Hope this helps, Steve-O //Show Don't Ask Dialog... procedure TForm1.Button1Click(Sender: TObject); var frmSampleDialog : TfrmSampleDialog; begin frmSampleDialog := TfrmSampleDialog.Create(nil); try if frmSampleDialog.Execute then begin if frmSampleDialog.DontAsk then begin ShowMessage('Dont Ask'); end else begin ShowMessage('Ask'); end; end; finally frmSampleDialog.Free; end; end; //Don't Ask Dialog... type TfrmSampleDialog = class(TForm) cbDontAsk: TCheckBox; btnCancel: TButton; btnOK: TButton; private function GetDontAsk: boolean; { Private declarations } public { Public declarations } function Execute : boolean; property DontAsk : boolean read GetDontAsk; end; var frmSampleDialog: TfrmSampleDialog; implementation {$R *.DFM} { TfrmSampleDialog } function TfrmSampleDialog.Execute: boolean; begin result := (ShowModal = mrOK); end; function TfrmSampleDialog.GetDontAsk: boolean; begin result := cbDontAsk.Checked; end; |
mARCELO
![]() Delphi Developer |
2004-07-22 09:54:19 PM
Re:MessageBox + checkbox
It works!
i did not think about use that before thank you very much "steve-o" <XXXX@XXXXX.COM>escreveu na mensagem Quote"mARCELO" <XXXX@XXXXX.COM>writes |
theo
![]() Delphi Developer |
2004-07-23 06:08:56 PM
Re:MessageBox + checkbox
I think this doesn't work as expected.
The frmSampleDialog is created and "freed" in the same button-click-event. The next time you click Button1, it is creating a new frmSampleDialog which doesn't remember the selected state. Create and free it in OnCreate / OnDestroy or let Delphi do it in the *.dpr file. Application.CreateForm(TForm2, Form2); And it would probably be enough to call it by: if not frmSampleDialog.DontAsk then frmSampleDialog.Execute; |