utilities.bas

来自「这个是grs源程序,mo在图象显示上很好,所以大家一定要下载」· BAS 代码 · 共 37 行

BAS
37
字号
Attribute VB_Name = "modUtilities"
Public SDECon As New MapObjects2.DataConnection
Public bSDEConnected As Boolean

'CenterForm - Centers a form
Public Sub CenterForm(frm As Form)
  'Center the form
  frm.Top = (Screen.Height - frm.Height) \ 2
  frm.Left = (Screen.Width - frm.Width) \ 2
End Sub

'HiliteText - Hilights the contents of a text control
Public Sub HiliteText(Ctrl As Control)
  Ctrl.SelStart = 0
  Ctrl.SelLength = Len(Ctrl)
End Sub

' SplitPath - splits a path into dir name and filename w/out extension
Sub SplitPath(pathName As String, dirName As String, fileName As String)
  ' find the last occurance of a file separator
  ' in the path
  Dim nCurPos As Integer, nLastPos As Integer
  Do
    nLastPos = nCurPos
    nCurPos = InStr(nCurPos + 1, pathName, "\")
  Loop Until nCurPos = 0

  If nLastPos = 0 Then Exit Sub

  Dim fname As String
  dirName = Left(pathName, nLastPos - 1)
  fname = Right(pathName, Len(pathName) - nLastPos)
  fileName = Left(fname, Len(fname) - 4)
End Sub


⌨️ 快捷键说明

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