Recent

Author Topic: MessageBox inside MainForm?  (Read 494 times)

d2010

  • Jr. Member
  • **
  • Posts: 65
MessageBox inside MainForm?
« on: October 22, 2024, 09:04:04 am »
Hello.
Can we develop more features for MessageBoxYesNo inside "MainForm"?
==I have the solution inside "Delphi3" but for lazarus i do not experience.
I am interested "MessageBoxYesNo" for your-project with Lazarus.exe?
I hope your-project can be sharing with me, or sharing with others.
or you develope other tiny project.lpr foe testing together online.
Code: [Select]
    object PageControl: TPageControl
      Left = 12
      Top = 12
      Width = 409
      Height = 227
      HelpContext = 1650
      ActivePage = DirCondPage
      Align = alClient
      MultiLine = True
      TabOrder = 0
      object AutoexecPage: TTabSheet
        HelpContext = 1770
        Caption = 'Autoexec.bat'
        object TLabel
          Left = 648
          Top = 0
          Width = 44
          Height = 13
          Caption = 'Location:'
        end
        object Memo2: TMemo
          Left = 0
          Top = 0
          Width = 401
          Height = 199
          Align = alClient
          Font.Charset = DEFAULT_CHARSET
          Font.Color = clWindowText
          Font.Height = -15
          Font.Name = 'MS Sans Serif'
          Font.Style = []
          ParentFont = False
          ScrollBars = ssBoth
          TabOrder = 0
        end
      end
« Last Edit: October 22, 2024, 09:13:58 am by d2010 »

Dzandaa

  • Sr. Member
  • ****
  • Posts: 393
  • From C# to Lazarus
Re: MessageBox inside MainForm?
« Reply #1 on: October 27, 2024, 01:37:32 pm »
Hi,

I don't fully understand your question...

From the Wiki:

Code: Pascal  [Select][+][-]
  1. uses
  2.   Forms, Dialogs, LCLType;
  3.  
  4. procedure DisplayMessageBox;
  5. var
  6.   Reply, BoxStyle: Integer;
  7. begin
  8.   BoxStyle := MB_ICONQUESTION + MB_YESNO;
  9.   Reply := Application.MessageBox('Press either button', 'MessageBoxDemo', BoxStyle);
  10.   if Reply = IDYES then Application.MessageBox('Yes       ', 'Reply',MB_ICONINFORMATION)
  11.     else Application.MessageBox('No         ', 'Reply', MB_ICONHAND);
  12. end;
  13.  

https://wiki.lazarus.freepascal.org/Dialog_Examples

B->
Regards,
Dzandaa

silvercoder70

  • Jr. Member
  • **
  • Posts: 98
    • Tim Coates
Re: MessageBox inside MainForm?
« Reply #2 on: November 07, 2024, 11:06:31 pm »
I understand what you mean...

Mostly I use the standard message dialogs as provided by the environment as suggested in the previous post.

But there was a time (a while ago) when I also required a dialog box with a timeout - that is, if the user did not respond in a reasonable time, the form would close with the default option selected.
Explore the beauty of modern Pascal programming with Delphi & Free Pascal - https://www.youtube.com/@silvercoder70

 

TinyPortal © 2005-2018