⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmsize.frm

📁 vb实现最短路径Dijkstra算法
💻 FRM
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frmSize 
   BorderStyle     =   4  'Fixed ToolWindow
   Caption         =   "size"
   ClientHeight    =   1110
   ClientLeft      =   45
   ClientTop       =   285
   ClientWidth     =   1845
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1110
   ScaleWidth      =   1845
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Begin MSComCtl2.UpDown UpDownWidth 
      Height          =   315
      Left            =   1485
      TabIndex        =   4
      Top             =   165
      Width           =   240
      _ExtentX        =   423
      _ExtentY        =   556
      _Version        =   393216
      Value           =   1
      BuddyControl    =   "txtWidth"
      BuddyDispid     =   196610
      OrigLeft        =   915
      OrigTop         =   255
      OrigRight       =   1155
      OrigBottom      =   510
      Increment       =   10
      Max             =   1000
      Min             =   1
      SyncBuddy       =   -1  'True
      BuddyProperty   =   65547
      Enabled         =   -1  'True
   End
   Begin VB.TextBox txtHeight 
      Height          =   315
      Left            =   645
      TabIndex        =   1
      Text            =   "100"
      Top             =   645
      Width           =   765
   End
   Begin VB.TextBox txtWidth 
      Height          =   315
      Left            =   660
      TabIndex        =   0
      Text            =   "100"
      Top             =   150
      Width           =   765
   End
   Begin MSComCtl2.UpDown UpDownHeight 
      Height          =   315
      Left            =   1455
      TabIndex        =   5
      Top             =   645
      Width           =   240
      _ExtentX        =   423
      _ExtentY        =   556
      _Version        =   393216
      Value           =   1
      BuddyControl    =   "txtHeight"
      BuddyDispid     =   196609
      OrigLeft        =   915
      OrigTop         =   255
      OrigRight       =   1155
      OrigBottom      =   510
      Increment       =   10
      Max             =   1000
      Min             =   1
      SyncBuddy       =   -1  'True
      BuddyProperty   =   65547
      Enabled         =   -1  'True
   End
   Begin VB.Label Label2 
      Alignment       =   1  'Right Justify
      AutoSize        =   -1  'True
      Caption         =   "height:"
      Height          =   195
      Left            =   45
      TabIndex        =   3
      Top             =   720
      Width           =   480
   End
   Begin VB.Label Label1 
      Alignment       =   1  'Right Justify
      AutoSize        =   -1  'True
      Caption         =   "width:"
      Height          =   195
      Left            =   60
      TabIndex        =   2
      Top             =   225
      Width           =   420
   End
End
Attribute VB_Name = "frmSize"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'  ==========================================
'  Dijkstra's algorithm to find Shortest Path
'  ==========================================
'
' E.W. Dijkstra is a Dutch professor in Computer
' Science, who did a lot of research in graphs.
'
' Dijkstra's algorithm is of use when working with
' directional graphs. It constructs the shortest path
' between a starting-node and a goal-node.
' It is assumed that every link between two nodes
' has a certain cost, and this algorithm finds the
' path between the two given nodes with the lowest cost.
'
' The idea of this VB project was to show the
' work of this algorithm in a visual way.
'
'    Screen-shot: dijkstra.gif
'
'
'    Visit my Homepage:
'    http://www.geocities.com/emu8086/vb/
'
'
'    Last Update: Saturday, July 20, 2002
'
'
'    Copyright 2002 Alexander Popov Emulation Soft.
'               All rights reserved.
'        http://www.geocities.com/emu8086/


Option Explicit

Private Sub Form_Activate()
    If SELECTED_SHAPE <> -1 Then
        UpDownWidth.Value = Form1.shp(SELECTED_SHAPE).Width
        UpDownHeight.Value = Form1.shp(SELECTED_SHAPE).Height
    End If
End Sub

Private Sub UpDownWidth_Change()
    If SELECTED_SHAPE <> -1 Then
        Form1.shp(SELECTED_SHAPE).Width = UpDownWidth.Value
        If Form1.shp(SELECTED_SHAPE).Shape = 1 Or Form1.shp(SELECTED_SHAPE).Shape = 3 Then
            Form1.shp(SELECTED_SHAPE).Height = Form1.shp(SELECTED_SHAPE).Width
            'UpDownHeight.Value = Form1.shp(SELECTED_SHAPE).Height
        End If
        Form1.theLineCollection.updateLines
    End If
End Sub

Private Sub UpDownHeight_Change()
    If SELECTED_SHAPE <> -1 Then
        Form1.shp(SELECTED_SHAPE).Height = UpDownHeight.Value
        If Form1.shp(SELECTED_SHAPE).Shape = 1 Or Form1.shp(SELECTED_SHAPE).Shape = 3 Then
            Form1.shp(SELECTED_SHAPE).Width = Form1.shp(SELECTED_SHAPE).Height
            'UpDownWidth.Value = Form1.shp(SELECTED_SHAPE).Width
        End If
        Form1.theLineCollection.updateLines
    End If
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -