Announcement

Collapse
No announcement yet.

inputbox$ question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • inputbox$ question

    Is it possible to change the height and length of the inputbox$ statement ?
    The syntax allows to edit the position of the box , but I haven't found any clue to change the dimension of the box itself .
    Reason I ask this is that the message in the box is truncated .

  • #2
    It's a wrapped MS function IIRC. Search the forums though, since this question has come up before.

    It is easy enough to do your own dialog, which offers a lot more control to get what you may desire.
    Rick Angell

    Comment


    • #3
      Inputbox$

      Hi Frank;

      I don't think it is possible to change the size of the INPUTBOX$. However, the text can be displayed on multiple lines.


      Example:
      Code:
      Command = INPUTBOX$("S/W Version: " + $swver + $CR + "Get or Set, Parameter, A1, A2, A3" + $CR + "or" + $CR + "Call, Function" + $CR+$CR + "DLL Ver: " + dllver + $CR + "BIOS: " + BIOS + $CR + "Device ID: " + DeviceID, "Enter Command:", , 640, 150)
      Last edited by Walt Thompson; 14 Nov 2008, 12:07 PM. Reason: Syntax error

      Comment


      • #4
        I don't think it is possible to change the size of the INPUTBOX$.
        You can, but that requires SDK code and a WH_CBT hook.
        Dominic Mitchell
        Phoenix Visual Designer
        http://www.phnxthunder.com

        Comment


        • #5
          Originally posted by Walter Thompson View Post
          Hi Frank;

          I don't think it is possible to change the size of the INPUTBOX$. However, the text can be displayed on multiple lines.

          Example:
          Code:
          Command = INPUTBOX$("S/W Version: " + $swver + $CR + "Get or Set, Parameter, A1, A2, A3" + $CR + "or" + $CR + "Call, Function" + $CR+$CR + "DLL Ver: " + dllver + $CR + "BIOS: " + BIOS + $CR + "Device ID: " + DeviceID, "Enter Command:", , 640, 150)
          Thanks , indeed the problem is the header text .
          Can you explain how the command you give works ?

          Comment


          • #6
            The text to be displayed is being split into smaller strings and a $CR (carriage return) inserted between them to force the next line of text.
            Last edited by Richard Angell; 15 Nov 2008, 08:04 AM. Reason: corrected text
            Rick Angell

            Comment


            • #7
              Inputbox$

              Hi Frank;

              Here is a simple test program that demonstrates how the technique works.

              Code:
              #COMPILE EXE
              #DIM ALL
              
              $swver =    "Test 1.0"
              $dllver =   "Rev A"
              $BIOS =     "345AB"
              
              FUNCTION PBMAIN () AS LONG
                  STATIC Cmd AS STRING
              
                      DO UNTIL LCASE$(Cmd) = "exit"
                      Cmd = INPUTBOX$("S/W Version: " + $swver + $CR + "Get or Set, Parameter, A1, A2, A3" + $CR + "or" + $CR + "Call, Function" + $CR +$CR + "DLL Ver: " + $dllver + $CR + "BIOS: " + $BIOS, "Enter Command:", , 640, 150)
                      SELECT CASE LCASE$(LEFT$(Cmd, 4))
                          CASE "exit", "e", "q"
                              IF Cmd = "e" THEN Cmd = "exit"
                              IF Cmd = "q" THEN Cmd = "exit"
                              ?"",,"End Program"
                              EXIT SELECT
                              
                          CASE ELSE
                              ?Cmd,,"Text Entered"
                      END SELECT
                      LOOP
              END FUNCTION

              Comment


              • #8
                Since the InputBox$ sizes itself based on the text string length(s)...
                Unfortuately not - inputbox$ has a fixed width and depth - tested with both PBWin8 & 9.
                Rgds, Dave

                Comment


                • #9
                  Thank you guys . It works displaying text on multiple lines .!
                  I've also noticed the PB performs a CR when it encounters a blank in the text field.

                  Comment


                  • #10
                    >I've also noticed the PB performs a CR when it encounters a blank in the text field.

                    MSGBOX "Hello World" on my system does not do that.
                    Michael Mattias
                    Tal Systems (retired)
                    Port Washington WI USA
                    [email protected]
                    http://www.talsystems.com

                    Comment


                    • #11
                      Originally posted by Michael Mattias View Post
                      >I've also noticed the PB performs a CR when it encounters a blank in the text field.

                      MSGBOX "Hello World" on my system does not do that.
                      Addition : it does at the end of the line . Jumps to the next line when there's a blank

                      Comment


                      • #12
                        You mean it word-breaks when the text to be displayed does not fit on one line?
                        Michael Mattias
                        Tal Systems (retired)
                        Port Washington WI USA
                        [email protected]
                        http://www.talsystems.com

                        Comment


                        • #13
                          Originally posted by Michael Mattias View Post
                          You mean it word-breaks when the text to be displayed does not fit on one line?
                          Yes it is , but it doesn't break words except when theres a blank between the words

                          Comment

                          Working...
                          X