home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form Form2
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "Example 2: NetWork"
- ClientHeight = 4200
- ClientLeft = 1095
- ClientTop = 1830
- ClientWidth = 6270
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 4605
- Left = 1035
- LinkTopic = "Form2"
- MDIChild = -1 'True
- ScaleHeight = 4200
- ScaleWidth = 6270
- Tag = "2"
- Top = 1485
- Width = 6390
- Begin VB.PictureBox Picture1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- ForeColor = &H80000008&
- Height = 525
- Index = 0
- Left = 3120
- ScaleHeight = 495
- ScaleWidth = 555
- TabIndex = 4
- Top = 3615
- Visible = 0 'False
- Width = 585
- End
- Begin VB.PictureBox Picture1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- ForeColor = &H80000008&
- Height = 525
- Index = 3
- Left = 4950
- Picture = "NETWORK.frx":0000
- ScaleHeight = 495
- ScaleWidth = 555
- TabIndex = 2
- Top = 3615
- Visible = 0 'False
- Width = 585
- End
- Begin VB.PictureBox Picture1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- ForeColor = &H80000008&
- Height = 525
- Index = 2
- Left = 4335
- Picture = "NETWORK.frx":0442
- ScaleHeight = 495
- ScaleWidth = 555
- TabIndex = 1
- Top = 3615
- Visible = 0 'False
- Width = 585
- End
- Begin VB.PictureBox Picture1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- ForeColor = &H80000008&
- Height = 525
- Index = 1
- Left = 3735
- Picture = "NETWORK.frx":0884
- ScaleHeight = 495
- ScaleWidth = 540
- TabIndex = 0
- Top = 3615
- Visible = 0 'False
- Width = 570
- End
- Begin EasynetLib.Easynet Net1
- Height = 3210
- Left = 240
- TabIndex = 3
- Top = 195
- Width = 4590
- _Version = 65538
- _ExtentX = 8096
- _ExtentY = 5662
- _StockProps = 101
- BackColor = 16777215
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- name = "MS Sans Serif"
- charset = 0
- weight = 400
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- BorderStyle = 1
- xGrid = 5
- yGrid = 5
- Shape = 0
- FillColor = 16777215
- DrawColor = 0
- ForeColor = 0
- DrawWidth = 1
- Oriented = -1 'True
- ReadOnly = 0 'False
- MultiSel = -1 'True
- ScrollBars = 3
- CanDrawNode = -1 'True
- CanDrawLink = -1 'True
- CanMoveNode = -1 'True
- CanSizeNode = -1 'True
- CanStretchLink = -1 'True
- CanMultiLink = -1 'True
- Transparent = 0 'False
- DrawStyle = 0
- Alignment = 7
- BackPicture = "NETWORK.frx":0B8E
- ShowGrid = 0 'False
- LinkHead = 0
- DoSelChange = -1 'True
- DoAddNode = -1 'True
- DoAddLink = -1 'True
- Hiding = 0 'False
- ImageFile = ""
- DisplayHandles = -1 'True
- Zoom = 100
- AutoSize = 0
- AutoScroll = -1 'True
- End
- Attribute VB_Name = "Form2"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Private Sub banner2()
- Dim Node(1 To 21) As Long
- With Net1
- Node(1) = .AddNodeItem
- .SetNodeRect Node(1), 4455, 180, 7140, 3135
- .ForeColor = 255
- .DrawStyle = 2
- .DrawColor = 255
- .Alignment = 6
- .Transparent = True
- .Text = Chr$(13) + Chr$(10) + "INTERNET"
- Node(2) = .AddNodeItem
- .SetNodeRect Node(2), 240, 150, 3765, 3255
- .ForeColor = 255
- .DrawColor = 255
- .DrawStyle = 2
- .Alignment = 6
- .Transparent = True
- .Text = Chr$(13) + Chr$(10) + "INTRANET"
- Node(3) = .AddNodeItem 'LAN
- .SetNodeRect Node(3), 540, 1935, 3510, 1980
- .Shape = 1
- .FillColor = 0
- Node(4) = .AddNodeItem 'Router
- .SetNodeRect Node(4), 3060, 2115, 3300, 2370
- .Shape = 7
- .FillColor = 0
- Node(5) = .AddNodeItem 'Router
- .SetNodeRect Node(5), 5025, 2100, 5265, 2340
- .Shape = 6
- .FillColor = 0
- Node(6) = .AddNodeItem 'Server
- .SetNodeRect Node(6), 690, 675, 1350, 1620
- .FillColor = 16777215
- .DrawStyle = 5
- .Alignment = 6
- .Shape = 1
- .Transparent = True
- .Text = "Server NT"
- .Picture = Picture1(3).Picture
- .Type = 3
- Node(7) = .AddNodeItem 'PC client
- .SetNodeRect Node(7), 1710, 1155, 2190, 1635
- .FillColor = 16777215
- .DrawStyle = 5
- .Shape = 1
- .Transparent = True
- .Picture = Picture1(1).Picture
- .Type = 1
- Node(8) = .AddNodeItem 'PC client
- .SetNodeRect Node(8), 1245, 2340, 1725, 2805
- .FillColor = 16777215
- .DrawStyle = 5
- .Shape = 1
- .Transparent = True
- .Picture = Picture1(1).Picture
- .Type = 1
- Node(9) = .AddNodeItem ' Mac client
- .SetNodeRect Node(9), 2175, 2340, 2655, 2820
- .FillColor = 16777215
- .DrawStyle = 5
- .Shape = 1
- .Transparent = True
- .Picture = Picture1(2).Picture
- .Type = 2
- Node(10) = .AddNodeItem
- .SetNodeRect Node(10), 1920, 1905, 1980, 1965
- .FillColor = 0
- .Shape = 1
- Node(11) = .AddNodeItem
- .SetNodeRect Node(11), 2385, 1935, 2445, 1995
- .FillColor = 0
- .Shape = 1
- Node(12) = .AddNodeItem
- .SetNodeRect Node(12), 1440, 1935, 1500, 1995
- .FillColor = 0
- .Shape = 1
- Node(13) = .AddNodeItem
- .SetNodeRect Node(13), 3165, 1950, 3225, 2010
- .FillColor = 0
- .Shape = 1
- Node(14) = .AddNodeItem
- .SetNodeRect Node(14), 960, 1905, 1020, 1965
- .FillColor = 0
- .Shape = 1
- Node(15) = .AddNodeItem
- .SetNodeRect Node(15), 5790, 750, 6270, 1125
- .FillColor = 8454143
- Node(16) = .AddNodeItem
- .SetNodeRect Node(16), 5805, 1995, 6270, 2385
- .FillColor = 8454143
- Node(17) = .AddNodeItem
- .SetNodeRect Node(17), 5130, 2475, 5565, 2820
- .FillColor = 8454143
- Node(18) = .AddNodeItem
- .SetNodeRect Node(18), 6570, 885, 6930, 1275
- .Transparent = True
- .DrawStyle = 5
- .Text = "..."
- Node(19) = .AddNodeItem
- .SetNodeRect Node(19), 6585, 1605, 6915, 1890
- .Transparent = True
- .DrawStyle = 5
- .Text = "..."
- Node(20) = .AddNodeItem
- .SetNodeRect Node(20), 4620, 1290, 5610, 1875
- .FillColor = 8454143
- .Text = "Internet provider"
- ' Set owners:
- ' The five little black boxes are owned by the "LAN" node
- .SetNodeOwner Node(10), Node(3)
- .SetNodeOwner Node(11), Node(3)
- .SetNodeOwner Node(12), Node(3)
- .SetNodeOwner Node(13), Node(3)
- .SetNodeOwner Node(14), Node(3)
- ' All other nodes inside the INTRANET node are owned by this node
- .SetNodeOwner Node(3), Node(2)
- .SetNodeOwner Node(4), Node(2)
- .SetNodeOwner Node(6), Node(2)
- .SetNodeOwner Node(7), Node(2)
- .SetNodeOwner Node(8), Node(2)
- .SetNodeOwner Node(9), Node(2)
- ' All nodes inside the INTERNET node are owned by this node
- .SetNodeOwner Node(20), Node(1)
- .SetNodeOwner Node(19), Node(1)
- .SetNodeOwner Node(18), Node(1)
- .SetNodeOwner Node(15), Node(1)
- .SetNodeOwner Node(16), Node(1)
- .SetNodeOwner Node(17), Node(1)
- .SetNodeOwner Node(5), Node(1)
- ' The link between intranet and internet
- Dim link As Long
- link = .AddLinkItem(Node(5), Node(4))
- .SetItemDrawWidth link, 2
- ' Other links
- .AddLinkItem Node(7), Node(10)
- .AddLinkItem Node(9), Node(11)
- .AddLinkItem Node(8), Node(12)
- .AddLinkItem Node(4), Node(13)
- .AddLinkItem Node(5), Node(20)
- .AddLinkItem Node(20), Node(15)
- .AddLinkItem Node(16), Node(20)
- .AddLinkItem Node(16), Node(15)
- .AddLinkItem Node(16), Node(17)
- .AddLinkItem Node(15), Node(18)
- .AddLinkItem Node(16), Node(19)
- .AddLinkItem Node(6), Node(14)
- .item = 0
- End With
- End Sub
- Private Sub Form_Activate()
- ActivateForm
- End Sub
- Private Sub Form_Deactivate()
- DeactivateForm
- End Sub
- Private Sub Form_Load()
- MDI1.ShowExample(1).Enabled = False
- MDI1.Command5.Enabled = False
- Net1.Left = 0
- Net1.Top = 0
- Net1.DrawStyle = 6
- Net1.Oriented = False
- SpeedON Net1
- banner2
- SpeedOFF Net1
- End Sub
- Private Sub Form_Resize()
- If WindowState <> 1 And ScaleHeight <> 0 Then
- Net1.Height = ScaleHeight
- Net1.Width = ScaleWidth
- End If
- End Sub
- Private Sub Form_Unload(Cancel As Integer)
- MDI1.ShowExample(1).Enabled = True
- MDI1.Command5.Caption = "Comments "
- End Sub
- Private Sub Net1_AddNode()
- If Net1.X2 - Net1.X1 < 200 Then Net1.X2 = Net1.X1 + 200
- If Net1.Y2 - Net1.Y1 < 200 Then Net1.Y2 = Net1.Y1 + 200
- End Sub
- Private Sub Net1_DblClick()
- frmItemProp.Show 1
- End Sub
- Private Sub Net1_KeyDown(KeyCode As Integer, Shift As Integer)
- If KeyCode = KEY_DELETE Then
- Net1.DeleteSel
- End If
- End Sub
-