Add checkbox to MessageDlg() lazarus / 8-Other ---------------------------------------------------------------------- Bart · 2007-01-21 12:22 Hi there, Is it possible to add a TCheckBox to a MessageDlg()? So that I can implement something like "Do not show this message again" and the user can check this, and I can act on it. Like this one (in Dutch language): (http://i25.photobucket.com/albums/c74/Talent111/devel/messagedlg_with _checkbox.png) (It says: "Warning" (the caption). "Note: the distance for class II is at least 40 km. " The caption of the checkbox says: "Do not show this warning again") I could of course write my own messageform, but that sounds silly, I want to reuse the available standard dialog (so I do not have to reproduce the calculation of with, height, placing of buttons etc. etc.). In Delphi I do this by using the CreateMessageDialog() function, wich returns a TForm, so I can create and place a checkbox on it. (I also use this to translate buttoncaptions, change default button, place the form centered over the calling for as opposed to the entire screen, etc. etc.). (I figured out how to do translation in Lazarus, so that's OK, although I prefer my own (Delphi) method) Lazarus however does not have a CreateMessageDialog function, and after looking at dialogs.pp, I cannot figure out if it is at all possible to obtain a "handle" to the dialogform. What it all boils down to is this: I want to get access to the controls and the form of the MessageDlg() function. Is this possible in Lazarus? If so, can you give me some hint as how to do this? If not, is there some better solution than to completely build a new MessageDlg() form from scratch ?? Thanks, Bart ---------------------------------------------------------------------- Marc · 2007-01-22 10:14 IIRC messagedialogs in Lazarus are made native. So they aren't a TForm. But I do understand that adding extra controls is sometimes needed. Please add a bugrep (if not done already) ---------------------------------------------------------------------- Bart · 2007-01-23 19:30 OK, I just did. Bart ---------------------------------------------------------------------- felipemdc · 2007-01-23 19:58 I´m not really sure of the usefulness of this .... if you need something more complex then a message dialog, just create a form. ---------------------------------------------------------------------- Bart · 2007-01-24 15:45 Hi, Quote from: "sekel"I´m not really sure of the usefulness of this .... if you need something more complex then a message dialog, just create a form. I disagree (of course, otherwise I would not have started the topic). If I can get access to the controls of, or am able to add controls to, the dialog I can use my "special messagedlg()" just like the original, I'm re-using the existing code. I'm not gonna write a form for a simple Yes/No dialog and a form for Abort/Retry/Ignore etc. etc. Of course I could do it more generic, but then I would have to duplicate many of the things that already exist in the messagedlg() function. As I do it now in Delphi I can also set the default button of the dialog this way. Maybe this can be done some other way in Lazarus. Groetjes, Bart