Results 1 to 4 of 4

Thread: How do you make Msgboxw text selectable ?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Question How do you make Msgboxw text selectable ?

    Hi,


    all in the title :

    How do you make Msgboxw text selectable -> Ctrl+C copy ?
    ThinBasic 1.11.6.0 ALPHA - Windows 8.1 x64

  2. #2
    Hi
    for the first time i know that while the msgBox is on if we press ctrl-C the msgbox text is copied to the clipboard. but selectable text seems not possible, look different approaches here: https://stackoverflow.com/questions/...ba-message-box
    someone have an approach of using a TextBox

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    You can create your own message box.

    Something like the following:

    USES "UI"
    
    
    begin ControlID
      %txt_Message
      %btn_OK
    end ControlID
    
    
    function MyMsgBox(byval hParent as long, byval sText as string, byval sCaption as string) as long
      DIALOG New Pixels   , Name frmMsgBox, 
                            hParent, 
                            sCaption,
                            -1, -1, 320, 240,
                            %WS_SYSMENU
                            
      CONTROL ADD Textbox , Name txtMessage  , frmMsgBox.Handle, %txt_Message   , "",  
                            5,  5, frmMsgBox.CW - 10,  frmMsgBox.CH - 100, 
                            %ES_WANTRETURN | %ES_MULTILINE | %ES_READONLY, %WS_EX_TRANSPARENT
                            
      CONTROL ADD BUTTON  , Name btnOK , frmMsgBox.Handle, %btn_OK  , "OK",
                            frmMsgBox.CW/2-50, frmMsgBox.CH - 50, 100,  25, %BS_DEFAULT | %WS_TABSTOP
    
    
      txtMessage.Text = sText
      
      DIALOG SHOW MODAL frmMsgBox.Handle
    
    
    end Function
    
    
    '------------------------------------------------
    CallBack Function frmMsgBox.OnLoad() As Long
    '------------------------------------------------
      txtMessage.BackColor = Win_GetSysColor(%COLOR_BTNFACE)
      
    End Function
    '------------------------------------------------
    ' Function fired when button Run me is clicked
    '------------------------------------------------
    CallBack Function btnOK.OnClick() As Long
    '------------------------------------------------
      frmMsgBox.Close
    End Function
    
    
    
    
    MyMsgBox(0, "Hi there" + $crlf + "from thinBAsic", "My Message Box")
    
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  4. #4

    Thumbs up

    Thanks both!

    @Primo, as stated in the link you provide Ctrl+C on the Msgbox is not user friendly as it catches the title and the 'OK' button texts.
    @Eros, I understand the 'own' message box.

    First, I thought that the stackO link gave me a third approach, quick & clean: the inputbox (InputBox$ in TB) but unfortunately it's not InputBoxW$. Thus, Eros, you did provide the answer I needed.

    Thanks both!
    ThinBasic 1.11.6.0 ALPHA - Windows 8.1 x64

Similar Threads

  1. ListBox NonSelectable & Selectable
    By marcuslee in forum UI (User Interface)
    Replies: 3
    Last Post: 11-12-2009, 02:39
  2. Make video games
    By catventure in forum Gaming
    Replies: 1
    Last Post: 04-03-2009, 21:26
  3. Error for Make Directory
    By nrodes in forum File
    Replies: 3
    Last Post: 09-02-2009, 00:23
  4. How to Make a Cheap Multitouch Pad
    By ErosOlmi in forum Technology
    Replies: 6
    Last Post: 05-05-2008, 07:32
  5. Is there a way to make the DLL smaller?
    By Michael Hartlef in forum Module SDK (Power Basic version)
    Replies: 6
    Last Post: 28-02-2007, 00:12

Members who have read this thread: 0

There are no members to list at the moment.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •