Results 1 to 2 of 2

Thread: Opening a Saved file

Hybrid View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Posts
    482

    Post

    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

  2. #2
    Lively Member
    Join Date
    Nov 1999
    Posts
    98

    Post

    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)

    Code:
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width