画面位置保存 (subPutFormIchi)

 

‘INIファイルの指定セクションに文字列を書き込む関数の宣言
Public Declare Function WritePrivateProfileString Lib "kernel32.dll" _
                 Alias "WritePrivateProfileStringA" _
                 (ByVal lpAppName As String, _
                  ByVal lpKeyName As String, _
                  ByVal lpString As String, _
                  ByVal lpFileName As String) As Long

‘/*************************************************/
‘/* [ 名 称 ] subPutFormIchi   : 画面位置保存                                
‘/* [ 引 数 ] objForm          : 入力 (フォームオブジェクト)                 
‘/* [ 戻 値 ] なし                                                           
‘/* [ 概 要 ] 表示した画面位置をINIファイルに保存する。                      
‘/*           Form_Unloadイベント時に呼び出す。                              
‘/* [ 履 歴 ] 2003/11/01 新規 v01.00 会社名 担当者名                      
‘/*************************************************/
Public Sub subPutFormIchi(ByRef objForm As Form)
On Error GoTo Err_subPutFormIchi
‘変数宣言———————————————————————
    Dim strPathFile             As String    ‘INIファイルのフルパス変数
    Dim lngWin32apiResultCode   As Long      ‘WindowsAPIの戻り値変数
‘—————————————————————————–





    ‘INIファイルのフルパスを編集する。
    strPathFile = App.Path & "\" & App.EXEName & ".INI"

    ‘値を書き込み
    lngWin32apiResultCode = WritePrivateProfileString _
                           (objForm.Name, _
                            "TOP", _
                            objForm.Top, _
                            strPathFile)
    ‘値を書き込み
    lngWin32apiResultCode = WritePrivateProfileString _
                           (objForm.Name, _
                            "LEFT", _
                            objForm.Left, _
                            strPathFile)
    ‘関数を終了する
    Exit Sub  

Err_subPutFormIchi:
    ‘ランタイムエラーが発生したのでエラー処理をする
    Call subErrSyori("subPutFormIchi", Err.Number, Err.Description)
End Sub

 

Visual Basic TIPS集

初期登録日: 2003年11月09日

最終更新日: 2003年11月10日

< Home ヘ戻る >


キーボード

ブラウザ画面の文字サイズを変更するショートカットキー

  1. [ CTRL ] + [ + ]  :  文字を大きく
  2. [ CTRL ] + [ ]  :  文字を小さく

Shortcut Keys

  1. [ CTRL ] + [ + ]  :  Up the font size
  2. [ CTRL ] + [ ]  :  Down the font size