不会,有知道的指点一下

解决方案 »

  1.   

    网上大把,
    http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=1&txtCodeId=4320
      

  2.   

    Private Declare Function SendMessage Lib "user32" Alias _
             "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
             ByVal wParam As Long, ByVal lParam As Long) As Long      Private Const WM_PAINT = &HF
          Private Const WM_PRINT = &H317
          Private Const PRF_CLIENT = &H4&    ' Draw the window's client area
          Private Const PRF_CHILDREN = &H10& ' Draw all visible child windows
          Private Const PRF_OWNED = &H20&    ' Draw all owned windows      Private Sub Command1_Click()
           Dim rv As Long
           Picture1.SetFocus  ' So that the button doesn't look pressed
           Picture2.AutoRedraw = True
           rv = SendMessage(Picture1.hwnd, WM_PAINT, Picture2.hDC, 0)
           rv = SendMessage(Picture1.hwnd, WM_PRINT, Picture2.hDC, _
              PRF_CHILDREN + PRF_CLIENT + PRF_OWNED)
           Picture2.Picture = Picture2.Image
           Picture2.AutoRedraw = False
           Command1.SetFocus  ' Return Focus
          End SubPrivate Sub Command2_Click()
           Printer.Orientation = vbPRORLandscape   ' 2
           Printer.Print ""
           Printer.PaintPicture Picture2.Picture, 0, 0
           Printer.EndDocEnd SubPrivate Sub Form_Load()
       Dim nodX As Node
       Set nodX = TreeView1.Nodes.Add(, , "R", "根节点", 1)
       Set nodX = TreeView1.Nodes.Add("R", tvwChild, "C1", "节点 1", 1)
       Set nodX = TreeView1.Nodes.Add("C1", tvwChild, "C2", "节点 2", 1)
       Set nodX = TreeView1.Nodes.Add("C2", tvwChild, "C3", "节点 3", 1)
       Set nodX = TreeView1.Nodes.Add("R", tvwChild, "C4", "节点 4", 1)
       nodX.EnsureVisible
       TreeView1.Style = tvwTreelinesPlusMinusPictureText '样式 4。
    End Sub