Welcome to my website. I am always posting links to photo albums, art, technology and other creations. Everything that you will see on my numerous personal sites is powered by the formVistaTM Website Management Engine.

icon.linkedin.jpgicon.twitter.jpg

  • VB6, Centering a Form on the Screen
    10/08/2008 2:56PM
    Here is a code snippet used to center a form on the screen.

    Private Sub Form_Load()
        ' Centering the form on the screen
        Me.Move (Screen.Width - Me.Width) \ 2, (Screen.Height - Me.Height) \ 2
    End Sub


  • VB6 Code for Openning an External File
    10/08/2008 2:53PM
    The following VB6 code will open an external file with it's associated application.  This assumes that there is an application on the system that is already associated with a specific executable. Under your General Declarations:

    ' Runs an external file/launches it's associated app
    Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

    On whatever Form/Button/Event

    Dim FileName As String
    FileName = "C:\path\to\some\file.pdf"
    ShellExecute 0&, "open", FileName, "", "", vbNormalFocus

Advanced Search

Categories

Archives