求 vb6 高手 (解决!!)

Home Home
引用 | 编辑 zsx123665
2012-07-02 22:10
楼主
推文 x0
详细专案:


Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
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
Function GetIniS(ByVal inifilename As String, ByVal SectionName As String, ByVal KeyWord As String, Optional ByVal DefString As String) As String
    Dim ResultString As String * 128, Temp%
    Dim s$, i%
    Temp% = GetPrivateProfileString(SectionName, KeyWord, "", ResultString, 144, inifilename)
    If Temp% > 0 Then
        For i = 1 To 128
            If Asc(Mid$(ResultString, i, 1)) <> 0 Then
                s = s & Mid$(ResultString, i, 1)
            End If
        Next
    Else
        Temp% = WritePrivateProfileString(SectionName, KeyWord, DefString, inifilename)
        s = DefString
    End If
    GetIniS = s
End Function


Private Sub Command1_Click()
On Error GoTo wtf
Image1(0).Picture = LoadPicture(App.Path & "\Data\Background\Maps\kengdie.bmp")
Image1(1).Picture = LoadPicture(App.Path & "\Data\Background\Maps\kengdie.bmp")
Image1(2).Picture = LoadPicture(App.Path & "\Data\Background\Maps\kengdie.bmp")
Image1(3).Picture = LoadPicture(App.Path & "\Data\Background\Maps\kengdie.bmp")
Image1(4).Picture = LoadPicture(App.Path & "\Data\Background\Maps\kengdie.bmp")
Image1(5).Picture = LoadPicture(App.Path & "\Data\Background\Maps\kengdie.bmp")
Image1(6).Picture = LoadPicture(App.Path & "\Data\Background\Maps\kengdie.bmp")
Image1(7).Picture = LoadPicture(App.Path & "\Data\Background\Maps\kengdie.bmp")
Image1(8).Picture = LoadPicture(App.Path & "\Data\Background\Maps\kengdie.bmp")
Label1(9).Caption = "N/A"
Label1(10).Caption = "N/A"
Label1(11).Caption = "N/A"
Label1(12).Caption = "N/A"
Label1(14).Caption = "N/A"
Label1(15).Caption = "N/A"
Label1(16).Caption = "N/A"
Label1(17).Caption = "N/A"
Label1(13).Caption = "N/A"
Label3(0).Caption = Label3(0).Caption - 1
Timer1.Enabled = True
Image1(Index).Picture = LoadPicture(App.Path & "\Data\Background\Maps\kengdie.bmp")
Label1(Index).Caption = ""
Dim i As Integer
Label2.Caption = (Label3(0).Caption - 1) * 9
For x = 0 To 8
 Label1(i).Caption = Trim(GetIniS(App.Path & "\Data\Setting\Maps.LS", "maps", Label2.Caption))
 Label1(i + 9).Caption = Trim(GetIniS(App.Path & "\Data\Setting\Maps.ini", "name", Label1(i).Caption))
 If Len(Dir(App.Path & "\Data\Background\Maps\" + Label1(i ..

访客只能看到部份内容,免费 加入会员



献花 x0
引用 | 编辑 ebolaman
2012-07-03 22:44
1楼
  
表单的 Object 名称要用 专案浏览器 表单左边的名称

Frist (Main.frm)

Frist 是 Object 名称,Main.frm 是档案名称



因此将名称改一下


Private Sub Image1_Click(Index As Integer)
Frist.Image1.Picture = Image1(Index).Picture
Frist.fk.Caption = Label1(Index).Caption
Dim y As Integer
y = Image1(Index).Tag + (Label3(0).Caption - 1) * 9
Dim z As String
z = y
x = WritePrivateProfileString("map", "lastchoice", z, App.Path & "\Data\Setting\Save.ini")
Unload Me
End Sub

献花 x1
引用 | 编辑 zsx123665
2012-07-04 12:50
2楼
  
下面是引用 ebolaman 于 2012-07-03 22:44 发表的 : 到引言文
表单的 Object 名称要用 专案浏览器 表单左边的名称
Frist (Main.frm)
Frist 是 Object 名称,Main.frm 是档案名称

因此将名称改一下
.......

你实在太强了 QAQ
原来是名称搞错 然怪一直找不到原因 Thx U (^_^) 

献花 x0
引用 | 编辑 ebolaman
2012-07-04 18:52
3楼
  
下面是引用 zsx123665 于 2012-07-04 12:50 发表的 : 到引言文


你实在太强了 QAQ
原来是名称搞错 然怪一直找不到原因 Thx U (^_^) 


不客气~

献花 x0