Resize textbox based on amount of text

Discussion in 'Questions (Windows Mobile)' started by N1c0_ds, Dec 2, 2008.

  1. N1c0_ds

    N1c0_ds Active Member Licensed User

    Would there be a way to calculate the textbox size based on how much lines of text there is in it? I don't want to have a scollable control in another scrollable control and that seems to be the best solution.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    A multiline textbox without scrollbars will help you?
     
  3. N1c0_ds

    N1c0_ds Active Member Licensed User

    I know but I already scroll the whole form (using a panel in a panel) so it makes a frame in a frame. Not cool.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

  5. N1c0_ds

    N1c0_ds Active Member Licensed User

    Thanks for the tip. I decided to just works with 3 "pages" instead of showing it all on a single panel.
     
  6. johnpc

    johnpc Member Licensed User

    Multiline Textbox

    How can you get a MultiLine Textbox without a vertical Scrollbar?
     
  7. klaus

    klaus Expert Licensed User

    You can do it with the Door library.
    Example in the attached program.

    Best regards.
     

    Attached Files:

  8. johnpc

    johnpc Member Licensed User

    Thank you Klaus but I am having trouble implementing this. How would one go
    about it on App Start just showing one textbox?
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    Changing the text alignment of a textbox with FormLib.TextAlignment will also change it to a multiline textbox without scrollbars as a side effect.
    So you can just change the alignment to left (which will have no effect on the alignment) and it will become a multiline textbox without scrollbars.
     
  10. klaus

    klaus Expert Licensed User

    Erel's solution is easier than what I proposed.

    But the App_Start routine would look like this.
    Code:
    [FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]obj.New1([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]False[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])[/SIZE][/FONT]
    [SIZE=
    2][FONT=Courier New]obj.FromControl([/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"TextBox1"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])[/SIZE][/FONT]
    [SIZE=
    2][FONT=Courier New][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]obj.SetProperty([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"ScrollBars"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2],[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"None"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])[/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][/SIZE][/FONT][/FONT][/SIZE][/SIZE][/FONT]
    Best regards.
     
  11. N1c0_ds

    N1c0_ds Active Member Licensed User

    Thanks for the info. I'll use a textbox without a scrollbar to put a bigger scrollbar (with ControlsEx) to its side. The only thing is that I don't know how to tell the scrollbar the textbox was scrolled (using TouchFlo, for example).

    Anyone got an idea?
     
  12. johnpc

    johnpc Member Licensed User

    Thank you both, got it.
     
  13. johnpc

    johnpc Member Licensed User

    Sub App_Start

    Form1.Show
    obj.New1(False)
    obj.FromControl("TextBox1")
    obj.SetProperty("ScrollBars","None")

    TextBox1.Text="TextBox is used mostly to recieve user input."&CRLF
    TextBox1.Text=TextBox1.Text&"TextBox Control can be single line OR multiline."

    'Keep the focus off the TextBox set focus to a label that has no text
    Label1.Focus = True
    Label1.Focus

    End Sub
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice