Results 1 to 4 of 4

Thread: Creating (Rich)Textboxes during runtime

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2000
    Location
    London, UK
    Posts
    145
    Hello!
    I'm using an array of Rixhtextboxes, called Text(i), where i = 1,2,3 etc.
    When I load the form it only contents one textbox, Text(1). I want the user to be able to (by clicking a button) create a new textbox in the series, Text(2). Then, choose to either create Text(3) or delete Text(2), etc.
    Is there a way to do this?

    I've thought of creating a lot of textboxes, say Text(1-100), and making them visible or invisible instead of creating, deleting, but it would be rather inconvinent.

    So please, if you know how to do it, Help Me!!!

    Cheers,
    Pentax
    Wilhelm Tunemyr,
    Swede in London

    [email protected]

    "Dort, wo man Bücher verbrennt, verbrennt man am Ende auch Menschen"
    Heinrich Heine (1797-1856)

    Pravda vítezi!
    (Truth prevails!)

  2. #2
    Conquistador
    Join Date
    Dec 1999
    Location
    Australia
    Posts
    4,527
    here you go
    Code:
    Private Sub Command1_Click()
    Dim maxID As Integer
    maxID = rtf.Count
    Load rtf(maxID)
    rtf(maxID).Visible = True
    rtf(maxID).Top = rtf(maxID - 1).Top + rtf(maxID - 1).Height
    End Sub
    did this help?

  3. #3
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    and to unload a control array element

    Code:
    Unload text(?)
    Iain, thats with an i by the way!

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Feb 2000
    Location
    London, UK
    Posts
    145

    Well, it helped half way

    I can create textboxes allright, but I can't get them visible.
    I use them together with a TabStrip, so when you click on a tab I run a For series from i = 1 to [the amount of text-boxes, also the amount of tabs] stating that
    If i = TabStrip1.SelectedItem.Index Then
    Text(i).Visible = True
    Else:
    Text(i).Visible = False
    End If

    It doesn't work! Or rather, it works with Text(1), which hides when I click another tab end reappears when I click tab nr. one, but the new created textboxes doesn't show.
    It's not that they have wrong coordinates, I've checked and they are well inside the form.
    What can be wrong?

    I'm getting desperate...
    Pentax
    Wilhelm Tunemyr,
    Swede in London

    [email protected]

    "Dort, wo man Bücher verbrennt, verbrennt man am Ende auch Menschen"
    Heinrich Heine (1797-1856)

    Pravda vítezi!
    (Truth prevails!)

Posting Permissions

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



Click Here to Expand Forum to Full Width