我想在VB中实现类似OICQ中的框架,就是一点我的好友,出现一堆按钮,点陌生人出现一些按钮,怎么实现,请高手详细点告诉我,最好给我个例子,保证给分

解决方案 »

  1.   

    Private Sub Addlist_Click()
    Dim str As String
    str = InputBox("请输入主项标题")
    If str <> "" Then
        ctListBar1.Addlist str
    End If
    End SubPrivate Sub Button1_click()
    Unload Me
    End SubPrivate Sub ctListBar1_ItemClick(ByVal nList As Integer, ByVal nItem As Integer)
    frmtalk.Show
    End SubPrivate Sub ctlistbar1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
     If Button = 1 Then
           Call ReleaseCapture
           Call SendMessage(hwnd, WM_NCLBUTTONDOWN, HTCAPTION, 0)
     ElseIf Button = 2 Then
           PopupMenu Amenu
    End If
    End SubPrivate Sub Form_Load()
    '''''''''''''''''''''''
    Initctliatbar
    'tcpc.Protocol = sckTCPProtocol
    'tcpc.Listen
    End SubPrivate Sub Initctliatbar()
    ''''''''''''''''''''''''
    Dim lst1 As Integer, lst2 As Integer
    lst1 = ctListBar1.Addlist("我的情人")
    lst2 = ctListBar1.Addlist("我的敌人")
    ctListBar1.AddListItem 1, "企鹅", ctListBar1.Image1
    ctListBar1.AddListItem 1, "唐老鸭", ctListBar1.Image2
    ctListBar1.AddListItem 1, "强盗", ctListBar1.Image3
    ctListBar1.AddListItem 1, "小白兔", ctListBar1.Image4
    ctListBar1.AddListItem 1, "厨师", ctListBar1.Image5
    ctListBar1.AddListItem 1, "小狗", ctListBar1.Image6
    End SubPrivate Sub Mnutype_Click()
    Static ft As Boolean
    If ft = True Then
        ctListBar1.IconSize = IconLarge
        ft = False
    Else
        ctListBar1.IconSize = IconSmall
        ft = True
    End If
    End Sub