很簡單,在頁面上拖個treeview,可以直接給它實裝數據,運行一下,就可展開。
創新互聯公司是一家以網絡技術公司,為中小企業提供網站維護、網站設計制作、成都網站設計、網站備案、服務器租用、空間域名、軟件開發、微信小程序等企業互聯網相關業務,是一家有著豐富的互聯網運營推廣經驗的科技公司,有著多年的網站建站經驗,致力于幫助中小企業在互聯網讓打出自已的品牌和口碑,讓企業在互聯網上打開一個面向全國乃至全球的業務窗口:建站服務電話:13518219792
Public?Class?Form1
Dim?node(5)?As?TreeNode
Private?Sub?Form1_Load(sender?As?System.Object,?e?As?System.EventArgs)?Handles?MyBase.Load
? Dim?root?As?TreeNode
? With?TreeView1
? ? ? .Nodes.Clear()
? ? ? .ShowLines?=?True
? ? ? .ShowPlusMinus?=?True
? ? ? .ShowRootLines?=?True
? ? ? root?=?.Nodes.Add("倉庫")?'增加根節點
? ? ? .SelectedNode?=?root? '在此根節點下添加子節點
? ? ? For?i?=?1?To?6
? ? ? ? ? node(i?-?1)?=?.SelectedNode.Nodes.Add(i.ToString??"號倉庫")
? ? ? Next
? ? ? .ExpandAll()
? End?With
End?Sub
Private?Sub?Button1_Click(sender?As?System.Object,?e?As?System.EventArgs)?Handles?Button1.Click
? If?Val(TextBox1.Text)?=?100?And?Val(TextBox1.Text)?=?699?Then
? ? ? node(Val(TextBox1.Text)?\?100?-?1).Nodes.Add(TextBox1.Text)
? End?If
End?Sub
Private?Sub?Button2_Click(sender?As?System.Object,?e?As?System.EventArgs)?Handles?Button2.Click
? If?Val(TextBox2.Text)?=?1000000?And?Val(TextBox2.Text)?=?6999999?Then
? ? ? For?Each?child?As?TreeNode?In?node(Val(TextBox2.Text)?\?1000000?-?1).Nodes
? ? ? ? ? If?child.Text?=?TextBox2.Text.Substring(1,?3)?Then
? ? ? ? ? ? ? child.Nodes.Add(TextBox2.Text)
? ? ? ? ? ? ? Exit?For
? ? ? ? ? End?If
? ? ? Next
? End?If
End?Sub
End?Class
分類: 電腦/網絡 程序設計 其他編程語言
問題描述:
VB6中的form1.circle (100,200),rgb(0,255,0)的語句如何在VB中使用啊?
急用啊!!!!!!!!
解析:
VB與VB不同。
VB已經有專門繪圖的類。
可以定義筆刷然后用Drawing類中的方法繪制。
Private Sub DrawEllipse()
Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red)
Dim formGraphics as System.Drawing.Graphics
formGraphics = Me.CreateGraphics()
formGraphics.DrawEllipse(myPen, New Rectangle(0,0,200,300))
myPen.Dispose()
formGraphics.Dispose()
End Sub
Private Sub DrawRectangle()
Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red)
Dim formGraphics as System.Drawing.Graphics
formGraphics = Me.CreateGraphics()
formGraphics.DrawRectangle(myPen, New Rectangle(0,0,200,300))
myPen.Dispose()
formGraphics.Dispose()
End Sub
本文題目:vb.net節點圖 vbnet dir
文章源于:http://www.2m8n56k.cn/article40/dojhgeo.html
成都網站建設公司_創新互聯,為您提供手機網站建設、服務器托管、關鍵詞優化、云服務器、小程序開發、網站排名
聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:[email protected]。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯