darkwarpblade
Chieftain
- Joined
- Jul 29, 2002
- Messages
- 18
I can't figure out how to make any kind, though custom(like a saved gamed) would be nice to know.
;
;Note to user: DO NOT ALTER OR DELETE THIS FILE.
;
[SMS Inventory Identification]
Version=1.0
[Product Specification]
Product=Windows 2000 Professional
Version=5.0
Localization=English
ServicePackNumber=0
BitVersion=40
[Version]
DriverVer=11/14/1999,5.00.2183.1
[color=blue]Private Declare Function[/color] GetPrivateProfileString _
[color=blue]Lib[/color] "kernel32" [color=blue]Alias[/color] "GetPrivateProfileStringA" _
([color=blue]ByVal[/color] lpSectionName [color=blue]As String[/color] , _
[color=blue]ByVal[/color] lpKeyName [color=blue]As Any[/color] , _
[color=blue]ByVal[/color] lpDefault [color=blue]As String[/color] , _
[color=blue]ByVal[/color] lpReturnedString [color=blue]As String[/color] , _
[color=blue]ByVal[/color] nSize [color=blue]As Long[/color] , _
[color=blue]ByVal[/color] lpFileName [color=blue]As String[/color] )
[color=blue]As Long
Public Function[/color] GetKey(SectionName [color=blue]As String[/color], KeyName [color=blue]As String[/color], _
Inifile [color=blue]As String[/color]) [color=blue]As String[/color]
[color=green]'Retrieves a value from an ini file corresponding
'to the section and key name passed.[/color]
[color=blue]Dim[/color] Success [color=blue]As Long
Dim[/color] nSize [color=blue]As Long
Dim[/color] ret [color=blue]As String
Dim[/color] Defaultvalue [color=blue]As String[/color]
Defaultvalue = "Not Found"
[color=green]'call the API with the parameters passed.
'The return value is the length of the string
'in ret, including the terminating null. If a
'default value was passed, and the section or
'key name are not in the file, that value is
'returned. If no default value was passed (""),
'then success will = 0 if not found.
'Pad a string large enough to hold the data.[/color]
ret = Space$(2048)
nSize = Len(ret)
Success = GetPrivateProfileString(SectionName, KeyName, _
Defaultvalue, ret, nSize, Inifile)
[color=blue]If[/color] Success [color=blue]Then[/color]
GetKey = Left$(ret, Success)
[color=blue]End If
End Function[/color]
[color=blue]Private Declare Function[/color] WritePrivateProfileString _
[color=blue]Lib[/color] "kernel32" [color=blue]Alias[/color] "WritePrivateProfileStringA" _
([color=blue]ByVal[/color] lpSectionName [color=blue]As String[/color], _
[color=blue]ByVal[/color] lpKeyName [color=blue]As Any[/color], _
[color=blue]ByVal[/color] lpString [color=blue]As Any[/color], _
[color=blue]ByVal[/color] lpFileName [color=blue]As String[/color]) [color=blue]As Long[/color]
[color=blue]Function[/color] WriteKey(SectionName [color=blue]As String[/color], KeyName [color=blue]As String[/color], _
NewValue [color=blue]As String[/color], Inifile [color=blue]As String[/color])
[color=blue]Dim[/color] Success [color=blue]As Long[/color]
Success = WritePrivateProfileString(SectionName, KeyName, NewValue, Inifile)
WriteKey = Success
[color=blue]End Function[/color]
[color=blue]Function[/color] DeleteSection(SectionName [color=blue]As String[/color], Inifile [color=blue]As String[/color])
WritePrivateProfileString SectionName, _
vbNullString, vbNullString, Inifile
[color=blue]End Function[/color]
Originally posted by apiaster
Hi, can anyone tell me how to build a webpage with Visual Basic (such as with DHTML or any other means ?) My problem is, whenever I build a webpage (ex with DHTML,) it will always create a supporting .dll or .ocx or .exe (a supporting exe not a really executable file, you still run it from the HTML document) Free websites do not support dll's etc. Also you will need to tell the person that owns the server to actually activate the .dll in its new location (by typing regsvr32 documentname.dll)
Thanks in advance
Originally posted by ainwood
Is this in VB or VBA?
Maybe if you post your code it would help.![]()
Private Sub ButtonChecker()
Dim RowNumber As Integer
Select Case Application.Caller
Case "button 1"
RowNumber = 31
Do While Rows(RowNumber).EntireRow.Hidden = False
RowNumber = RowNumber + 1
Loop
If RowNumber >= 41 Then
MsgBox ("Only 10 rows available")
Else
ActiveSheet.Unprotect
Rows(RowNumber).EntireRow.Hidden = False
ActiveSheet.Protect
End If
Case "button 2"
' And so on...
Originally posted by ainwood
Well, good that you got it working!
Yes, Excel does strange things with embedded controls. You will find that any "new" controls are given a new name with a sequential number on the end - you could actually use the new name to change any cell references etc. You could detect the new one by creating a collection of the old ones, and enumerating all the controls to identify the new one when its created.
BTW - it looks like you used controls from the "forms" toolbar, rather than the "control toolbox" toolbar. They are actually slightly different - the "Control Toolbox" ones are better to use with VBA, whereas the forms ones are easier to use if you don't want to have to write macros.![]()
[color=blue]Function[/color] LongToHex(lngLong [color=blue]as Long[/color]) [color=blue]as string[/color]
LongToHex = Hex$(lngLong)
[color=blue]End Function
Function[/color] HexToLong(strHex [color=blue]As String[/color]) [color=blue]as Long[/color]
HexToLong = [color=blue]CLng[/color]("&H" & strHex)
[color=blue]End Function[/color]
[Color=green]'Write a "single" value to a binary file.[/color]
[color=blue]Sub[/color] WriteIt()
[color=blue]Dim[/color] i [color=blue]As Long[/color]
i = FreeFile
[color=blue]Dim[/color] sglPI [color=blue]As Single[/color]
sglPI = 3.141592
[color=blue]Open[/color] "C:\apps\hex.bin" [color=blue]For Binary As[/color] i
[color=blue]Put[/color] i, , sglPI
[color=blue]Put[/color] i, , sglPI
[color=blue]Close[/color] i
[color=blue]End Sub[/color]
[Color=green]'Read a "single" value from a binary file.[/color]
[color=blue]Sub[/color] ReadIt()
[color=blue]Dim[/color] i [color=blue]As Long[/color]
i = FreeFile
[color=blue]Dim[/color] sglPI [color=blue]As Single[/color]
[color=blue]Open[/color] "C:\apps\hex.bin" [color=blue]For Binary As[/color] i
[color=blue]Get[/color] i, 5, sglPI
[color=blue]Close[/color] i
[color=blue]Debug.Print[/color] sglPi
[color=blue]End Sub[/color]
[color=blue]Private Type[/color] DummySingle
Output [color=blue]As Single
End Type[/color]
[color=blue]Private Type[/color] HexBytes
TheBytes(0 [color=blue]To[/color] 3) [color=blue]As Byte
End Type[/color]
[color=blue]Function[/color] HexToSingle(strHex [color=blue]As String[/color]) [color=blue]As Single[/color]
[color=green]'declare a byte array[/color]
[color=blue]Dim bytHex [color=blue]As[/color] HexBytes
[color=blue]Dim[/color] i [color=blue]As Integer[/color]
[color=blue]For[/color] i = 0 [color=blue]To[/color] 3
bytHex.TheBytes(i) = [color=blue]CByte[/color]("&H" & Mid(strHex, i * 2 + 1, 2))
[color=blue]Next[/color] i
[color=blue]Dim[/color] sngOutput [color=blue]As[/color] DummySingle
[color=blue]LSet[/color] sngOutput = bytHex
HexToSingle = sngOutput.Output
[color=blue]End Function[/color]
Dim Unit As String
-----------------------------------------------------
Private Sub Command2_Click()
If Unit = "Units" Then
MsgBox , "Please choose a units type."
End If
If Unit = "Pixels" Then
Form1.Main.ScaleMode = 3
End If
If Unit = "Inches" Then
Form1.Main.ScaleMode = 5
End If
If Unit = "Centimeters" Then
Form1.Main.ScaleMode = 7
End If
If Unit = "Millimeters" Then
Form1.Main.ScaleMode = 6
End If
Form1.Main.Width = Text1.Text
Form1.Main.Height = Text2.Text
Form1.Main.Enabled = True
Form1.Main.Visible = True
Unload Form2
End Sub
-----------------------------------------------------
Private Sub Command3_Click()
Unload Form2
End Sub
-----------------------------------------------------
Private Sub Timer1_Timer()
Unit = Combo1.SelText
Text1.Text = VScroll1.Value
Text2.Text = VScroll2.Value
End Sub
[color=blue]Private sub[/color] combo1_change()
[color=blue]Select case[/color] combo1.listindex
[color=blue]case[/color] 0
[color=green]'it hasn't been changed[/color]
[color=blue]case[/color] 1
[color=green]'pixels[/color]
Form1.Main.ScaleMode = 3
[color=blue]case[/color] 2
[color=green]'Inches[/color]
Form1.Main.ScaleMode = 5
[color=blue]case[/color] 3
[color=green]'Centimeters[/color]
Form1.Main.ScaleMode = 7
[color=blue]case[/color] 4
[color=green]'Millimeters[/color]
Form1.Main.ScaleMode = 6
[color=blue]case else
end select[/color]
Form1.Main.Width = Text1.Text
Form1.Main.Height = Text2.Text
Form1.Main.Enabled = True
Form1.Main.Visible = True
Sub Auto_open()
Dim orderNum As Integer
Selection.GoTo What:=wdGoToBookmark, Name:="myBm"
orderNum = Val(ActiveDocument.Bookmarks("myBm").Value) + 1
Selection.Delete Unit:=wdCharacter, Count:=1
Selection.InsertAfter orderNum
ActiveDocument.Bookmarks.Add Range:=Selection.Range, _
Name:="myBm"
End Sub