0

我想要 的是:制作一个按钮,将这个FelxGrid中的选定数据导出为 .ini 文件格式,将(高度)作为部分,将其他作为值和键,它不必是 ini 格式,它也可以是一些东西靠近它

到目前为止我尝试了什么

Private Sub commandbutton_1()

Dim configfile As String
Dim myArray() As String 'i tried using arry but it didn't work 

configfile = "C:\" & "\CONFIGMEEE!.INI"


PutINISetting "", "", SettingsGrid.Clip, configfile


MsgBox "Exported.", vbInformation, "Settings"

SettingsGrid.SaveGrid configfile, flexFileTabText

然后发生 了什么我们导出但根本没有格式化为 ini 的数据并这样写:

在此处输入图像描述

重要的是要知道

flexgrid iam 使用的是 vsflexgrid 而不是 msflexgrid

我也把它用作MOUDLE

'API Function to write information to the INI File

Private Declare Function WritePrivateProfileString Lib "kernel32" _
    Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, _
    ByVal lpKeyName As Any, _
    ByVal lpString As Any, _
    ByVal lpFileName As String) As Long

'Get the INI Setting from the File
Public Function GetINISetting(ByVal sHeading As String, _
    ByVal sKey As String, _
    sINIFileName) As String

    Const cparmLen = 50
    Dim sReturn As String * cparmLen
    Dim sDefault As String * cparmLen
    Dim lLength As Long
    lLength = GetPrivateProfileString(sHeading, _
            sKey, _
            sDefault, _
            sReturn, _
            cparmLen, _
            sINIFileName)

    GetINISetting = Mid(sReturn, 1, lLength)
End Function

'Save INI Setting in the File
Public Function PutINISetting(ByVal sHeading As String, _
    ByVal sKey As String, _
    ByVal sSetting As String, _
    sINIFileName) As Boolean

    Const cparmLen = 50
    Dim sReturn As String * cparmLen
    Dim sDefault As String * cparmLen
    Dim aLength As Long
    aLength = WritePrivateProfileString(sHeading, _
        sKey, _
        sSetting, _
        sINIFileName)

    PutINISetting = True
End Function
4

0 回答 0