PDA

Click to See Complete Forum and Search --> : Opening a Saved file


progeix
Nov 26th, 1999, 03:31 AM
any one know how to open a file that has Command button settings?

I have 77 buttons and need to save their settings.

I have saved the settings as following:
Write #1,But.tag,but.caption,but.value, but.tooltiptext

Thats all one line
but i have 77 lines, one for each button.

Have tried but the VB Examples do not help with what i am going.

need a button that will open a file, and put the Tag,Caption,Value,Tooltiptext into the buttons

thank you

funkheads
Nov 26th, 1999, 02:12 PM
create a control array for the buttons (But(o), But(1), But(2), ..., But(76)) this will give you 77 total buttons.

then create a different button (not in that array) called cmdWriteToFile, or whatever you want it to be called, and use the following code: (actually, i guess you could use any control as the catalyst for the operation)


Private Sub cmdWriteToFile_Click()
Dim i As Integer
Dim c As Integer
c = But.Count
For i = 0 To c - 1
Write #1,_
But(i).tag,_
But(i).caption,_
But(i).value,_
But(i).tooltiptext
Next i
End Sub


do pretty much the same thing to read from the file and PUT the values in (on) the buttons. any more help, e-mail me at mpdulle@loyno.edu

good luck and happy programming