Results 1 to 6 of 6

Thread: A few questions...

  1. #1

    Thread Starter
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    How do I make a form stick to the right side of another form? and how do I delete and item selected in a listobx
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  2. #2
    Hyperactive Member WP's Avatar
    Join Date
    Aug 2000
    Location
    Belgium
    Posts
    278

    Wink RemoveItem

    How do I make a form stick to the right side of another form
    What exactly do you mean?

    and how do I delete and item selected in a listobx
    Try this:

    Code:
    Private Sub Form_Load()
       For i = 0 To 10'just an example
          List1.AddItem i
       Next i
    End Sub
    
    Private Sub Command1_Click()
       List1.RemoveItem List1.ListIndex :)
    End Sub
    WP

    Visual Basic 6.0 EE SP5 / .Net
    Windows XP

  3. #3
    Hyperactive Member marnitzg's Avatar
    Join Date
    Oct 2000
    Location
    South Africa
    Posts
    372

    If you have multiselect on

    Code:
    Dim I As Integer
    
    I = 0
    While I < List1.ListCount
        If List1.Selected(I) = True Then
            List1.RemoveItem I
            I = I - 1
        End If
        I = I + 1
    Wend

  4. #4

    Thread Starter
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    i mean by like 2 forms acting like winamp. you can move the main form and the other form will move too
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  5. #5
    Member
    Join Date
    Oct 2000
    Posts
    47

    Smile check out this code

    Private Type Attribots_To_Form2
    X As Single
    Y As Single
    End Type

    Private Moving_Thing As Attribots_To_Form2
    Private ok As Boolean

    Private Sub Form_Load()
    Load Form2
    Form2.Show
    End Sub

    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    ok = True
    Moving_Thing.X = X
    Moving_Thing.Y = Y
    End Sub

    Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If ok = True Then
    With Form1
    .Move .Left + X - Moving_Thing.X, .Top + Y - Moving_Thing.Y, .Width, .Height
    End With
    'moving the second form to the coordinates of the left+width of the first form
    With Form2
    .Move Form1.Left + Form1.Width, Form1.Top, .Width, .Height
    End With
    End If
    End Sub

    Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
    ok = False
    Moving_Thing.X = X
    Moving_Thing.Y = Y
    End Sub

    'Main Thing :
    'Try To Move The Main Form : Form1
    DealMan

  6. #6

    Thread Starter
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217

    Talking

    that works... sorta.... i just sorta tweaked it and now it works better. thanx!
    Remember, if someone's post was not helpful, you can always rate their post negatively .

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