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

📄 frmmain.frm

📁 GIS地理信息系统开发。大名鼎鼎的MAPX+VisualBasic6.0软件开发
💻 FRM
📖 第 1 页 / 共 5 页
字号:
         BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Select Polygon"
            Object.ToolTipText     =   "Select Polygon Tool"
            ImageIndex      =   9
         EndProperty
         BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Label"
            Object.ToolTipText     =   "Label Tool"
            ImageIndex      =   10
         EndProperty
         BeginProperty Button13 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Add Symbol Annotation"
            Object.ToolTipText     =   "Add Symbol Annotation Tool"
            ImageIndex      =   11
         EndProperty
         BeginProperty Button14 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Key             =   "Add Text Annotation"
            Object.ToolTipText     =   "Add Text Annotation Tool"
            ImageIndex      =   12
         EndProperty
      EndProperty
   End
   Begin VB.Menu mnuFile 
      Caption         =   "&File"
      Begin VB.Menu mnuFileOpen 
         Caption         =   "&Open Geoset..."
      End
      Begin VB.Menu mnuFileLayerAdd 
         Caption         =   "Add &Layer..."
      End
      Begin VB.Menu mnuFileBar0 
         Caption         =   "-"
      End
      Begin VB.Menu mnuFileSave 
         Caption         =   "&Save Geoset"
      End
      Begin VB.Menu mnuFileSaveAs 
         Caption         =   "Save &As..."
      End
      Begin VB.Menu mnuFileExport 
         Caption         =   "&Export..."
      End
      Begin VB.Menu mnuFileBar1 
         Caption         =   "-"
      End
      Begin VB.Menu mnuFilePageSetup 
         Caption         =   "Page Set&up..."
      End
      Begin VB.Menu mnuFilePrint 
         Caption         =   "&Print..."
      End
      Begin VB.Menu mnuFileBar2 
         Caption         =   "-"
      End
      Begin VB.Menu mnuFileExit 
         Caption         =   "E&xit"
      End
   End
   Begin VB.Menu mnuEdit 
      Caption         =   "&Edit"
      Begin VB.Menu mnuEditCopy 
         Caption         =   "&Copy"
         Shortcut        =   ^C
      End
      Begin VB.Menu mnuEditBar0 
         Caption         =   "-"
      End
      Begin VB.Menu mnuEditOptions 
         Caption         =   "&Options..."
      End
   End
   Begin VB.Menu mnuMap 
      Caption         =   "&Map"
      Begin VB.Menu mnuMapLayer 
         Caption         =   "&Layer Controls..."
      End
      Begin VB.Menu mnuMapBar0 
         Caption         =   "-"
      End
      Begin VB.Menu mnuMapInsertData 
         Caption         =   "&Insert Data..."
      End
      Begin VB.Menu mnuMapCreateTheme 
         Caption         =   "Create &Theme..."
      End
      Begin VB.Menu mnuMapModifyTheme 
         Caption         =   "&Modify Theme..."
      End
      Begin VB.Menu mnuMapModifyLegend 
         Caption         =   "Modify &Legend..."
      End
      Begin VB.Menu mnuMapBar1 
         Caption         =   "-"
      End
      Begin VB.Menu mnuMapFind 
         Caption         =   "&Find..."
      End
      Begin VB.Menu mnuMapSelectDistance 
         Caption         =   "&Select Within Distance..."
      End
      Begin VB.Menu mnuMapQuery 
         Caption         =   "&Query Selection..."
      End
      Begin VB.Menu mnuMapBar2 
         Caption         =   "-"
      End
      Begin VB.Menu mnuMapZoom 
         Caption         =   "&Zoom..."
      End
      Begin VB.Menu mnuMapViewEntire 
         Caption         =   "&View Entire Layer..."
      End
      Begin VB.Menu mnuMapProjection 
         Caption         =   "P&rojection..."
      End
      Begin VB.Menu mnuMapBar3 
         Caption         =   "-"
      End
      Begin VB.Menu mnuMapProperties 
         Caption         =   "&Properties..."
      End
   End
   Begin VB.Menu mnuTools 
      Caption         =   "&Tools"
      Begin VB.Menu mnuToolsArrow 
         Caption         =   "&Arrow"
      End
      Begin VB.Menu mnuToolsZoomIn 
         Caption         =   "&Zoom In"
      End
      Begin VB.Menu mnuToolsZoomOut 
         Caption         =   "Zoom &Out"
      End
      Begin VB.Menu mnuToolsPan 
         Caption         =   "&Pan"
      End
      Begin VB.Menu mnuToolsRuler 
         Caption         =   "&Ruler"
      End
      Begin VB.Menu mnuToolsBar0 
         Caption         =   "-"
      End
      Begin VB.Menu mnuToolsSelect 
         Caption         =   "&Select"
      End
      Begin VB.Menu mnuToolsSelectRectangle 
         Caption         =   "Select R&ectangle"
      End
      Begin VB.Menu mnuToolsSelectRadius 
         Caption         =   "Select Ra&dius"
      End
      Begin VB.Menu mnuToolsSelectPolygon 
         Caption         =   "Select P&olygon"
      End
      Begin VB.Menu mnuToolsBar1 
         Caption         =   "-"
      End
      Begin VB.Menu mnuToolsLabel 
         Caption         =   "&Label"
      End
      Begin VB.Menu mnuToolsAnnotations 
         Caption         =   "A&nnotations"
         Begin VB.Menu mnuToolsAddSymbolAnnotation 
            Caption         =   "&Symbol Tool"
         End
         Begin VB.Menu mnuToolsAddTextAnnotation 
            Caption         =   "&Text Tool"
         End
         Begin VB.Menu mnuToolsAnnotationsRemoveAll 
            Caption         =   "&Remove All"
         End
         Begin VB.Menu mnuToolsAnnotationStyle 
            Caption         =   "St&yle..."
         End
      End
   End
   Begin VB.Menu mnuView 
      Caption         =   "&View"
      Begin VB.Menu mnuViewToolbar 
         Caption         =   "&Toolbar"
      End
      Begin VB.Menu mnuViewMapTools 
         Caption         =   "&Map Tools"
      End
      Begin VB.Menu mnuViewStatusBar 
         Caption         =   "Status &Bar"
      End
      Begin VB.Menu mnuViewBar0 
         Caption         =   "-"
      End
      Begin VB.Menu mnuViewRefresh 
         Caption         =   "&Refresh"
      End
   End
   Begin VB.Menu mnuHelp 
      Caption         =   "&Help"
      Begin VB.Menu mnuHelpAbout 
         Caption         =   "&About "
      End
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function OSWinHelp% Lib "user32" Alias "WinHelpA" (ByVal hwnd&, ByVal HelpFile$, ByVal wCommand%, dwData As Any)

' This sample application and corresponding sample code is provided
' for example purposes only.  It has not undergone rigorous testing
' and as such should not be shipped as part of a final application
' without extensive testing on the part of the organization releasing
' the end-user product.

' See Module1.bas for global variable declarations

Dim MouseDownX1 As Double ' The ruler tool displays the distance as the mouse is moved.
                    ' These variables store the point at which the mouse was pressed
                    ' down
Dim MouseDownY1 As Double

Dim CheckedMenu As Menu ' The "Tools" menu item that is currently checked
Dim PressedButton As Button ' The Map Tool button that is currently down

Private Sub Form_Load()
    Me.Left = GetSetting(App.Title, "Settings", "MainLeft", 1000)
    Me.Top = GetSetting(App.Title, "Settings", "MainTop", 1000)
    Me.Width = GetSetting(App.Title, "Settings", "MainWidth", 6500)
    Me.Height = GetSetting(App.Title, "Settings", "MainHeight", 6500)
    Me.WindowState = GetSetting(App.Title, "Settings", "WindowState", vbNormal)

    ' Restore the settings that we saved in Form_Unload
    UsePolyRuler = GetSetting(App.Title, "Settings", "PolyRuler", False)
    ExportFormat = GetSetting(App.Title, "Settings", "ExportFormat", miFormatBMP)
    ExportFormatString = GetSetting(App.Title, "Settings", "ExportFormatString", "Windows Bitmap")
    ExportFormatExt = GetSetting(App.Title, "Settings", "ExportFormatExt", "*.bmp")
    ExportWidth = GetSetting(App.Title, "Settings", "ExportWidth", 0#)
    ExportHeight = GetSetting(App.Title, "Settings", "ExportHeight", 0#)
    RulerUnit = GetSetting(App.Title, "Settings", "RulerUnit", miUnitMile)
    RulerUnitString = GetSetting(App.Title, "Settings", "RulerUnitString", "Miles")
    Map1.MapUnit = RulerUnit
    
    mnuViewToolbar.Checked = GetSetting(App.Title, "Settings", "ToolbarVisibility", True)
    mnuViewStatusBar.Checked = GetSetting(App.Title, "Settings", "StatusBarVisibility", True)
    mnuViewMapTools.Checked = GetSetting(App.Title, "Settings", "MapToolsVisibility", True)
    tbToolBar.Visible = mnuViewToolbar.Checked
    Toolbar1.Visible = mnuViewMapTools.Checked
    sbStatusBar.Visible = mnuViewStatusBar.Checked
    
    Me.Caption = Map1.TitleText
    
    ' Create the line and polygon ruler tools, and assign them icons
    Map1.CreateCustomTool RulerToolID, miToolTypeLine, miSizeAllCursor
    Map1.CreateCustomTool PolyRulerToolID, miToolTypePoly, miSizeAllCursor
    
    ' Map1.PaperUnit is the unit needed for the Map.ExportMap call
    ' and the unit that Map.MapPaperHeight and Map.MapPaperWidth
    ' returns.
    Map1.PaperUnit = miPaperUnitInch
    
    ' CheckedMenu and PressedButton are the menu item and
    ' toolbar button that are depressed to show which is the
    ' current tool. These are manipulated in the mnuTools... functions
    ' By default, use the arrow tool
    Set CheckedMenu = mnuToolsArrow
    Set PressedButton = Toolbar1.Buttons(1)
    CheckedMenu.Checked = True
    PressedButton.Value = tbrPressed
End Sub

Private Sub Form_Resize()
    ' Avoid resizing to zero
    If Me.ScaleWidth > 420 And Me.ScaleHeight > tbToolBar.Height + sbStatusBar.Height Then
        ' Make sure the map does not obscure the toolbars
        ' and status bar, but make it take up the rest of
        ' the window
        If tbToolBar.Visible = True Then
            Map1.Top = tbToolBar.Height
            Map1.Height = Me.ScaleHeight - tbToolBar.Height
        Else
            Map1.Top = 0
            Map1.Height = Me.ScaleHeight
        End If
        If Toolbar1.Visible = True Then
            Map1.Left = 380 ' The width of the Map Tools toolbar
            Map1.Width = Me.ScaleWidth - 380
        Else
            Map1.Left = 0
            Map1.Width = Me.ScaleWidth
        End If
        If sbStatusBar.Visible = True Then
            Map1.Height = Map1.Height - sbStatusBar.Height
        End If
    End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Dim i As Integer

    ' close all sub forms
    For i = Forms.Count - 1 To 1 Step -1
        Unload Forms(i)

⌨️ 快捷键说明

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