Results 1 to 5 of 5

Thread: Form location and list boxes

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2002
    Location
    California! Sunny and warm.
    Posts
    4

    Question Form location and list boxes

    Hey people, hate to sound like an idiot but i'm a VB newb! Anyhow, I have a form of a set size which I would like to position on the right side of the screen. Which property can I use to set the startup position of the form, or is there any code where I can set its coordinates without resizing it?

    Also, I have a list box containing all the windows default fonts. I want the user to be able to click on the font, then click on a command button I have to select it. How do I manipulate the individual items in a list box? Thanks in advance for answers to both questions!
    __________________________
    - Irish Guitarist
    "Before you criticize someone, walk a mile in their shoes. That way, when you criticize them you're a mile away and you have their shoes."

  2. #2
    Frenzied Member numtel's Avatar
    Join Date
    Apr 2000
    Location
    CA
    Posts
    1,163
    put this is form_activate:
    VB Code:
    1. me.left = screen.width - me.width
    2. me.top=0
    that will put the current form in the top right.

  3. #3
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    To retrieve an item from a ListBox, the code is something like
    List1.ListItem(i)
    What do you mean by 'manipulate the individual items'?
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  4. #4

    Thread Starter
    New Member
    Join Date
    Feb 2002
    Location
    California! Sunny and warm.
    Posts
    4
    I have a list box with a bunch of items in it. I'm trying to make it so that when you click on an item in a list, the text appears in a text box. Thanks!
    __________________________
    - Irish Guitarist
    "Before you criticize someone, walk a mile in their shoes. That way, when you criticize them you're a mile away and you have their shoes."

  5. #5
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    Code:
    Private Sub List1_Click()
       Text1.Text = List1.List(List1.ListIndex)
    End Sub
    That'll do it.
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

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