Results 1 to 18 of 18

Thread: [RESOLVED] Writing Colors to ini for later use

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Apr 2005
    Location
    Debug.Print
    Posts
    3,885

    Resolved [RESOLVED] Writing Colors to ini for later use

    I am wanting to write the color values to a ini file for later use. This is the code I am using and what the output is. Am I doing it right or would you recommend a different approach?
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub cmdBackgroundColor_Click()
    4.     ShowColorPicker
    5.     lblColorScheme.BackColor = CDlgColorPicker.Color
    6. End Sub
    7.  
    8. Private Sub cmdForegroundColor_Click()
    9.     ShowColorPicker
    10.     lblColorScheme.ForeColor = CDlgColorPicker.Color
    11. End Sub
    12.  
    13. Private Sub ShowColorPicker()
    14.     With CDlgColorPicker
    15.         .Flags = cdlCCFullOpen
    16.         .ShowColor
    17.         .CancelError = True
    18.     End With
    19. End Sub
    20.  
    21. Private Sub cmdSave_Click()
    22.     Dim intFF As Integer, strFileName As String, strFileLocation As String
    23.    
    24.     intFF = FreeFile
    25.    
    26.     strFileName = "ColorScheme.ini"
    27.     strFileLocation = App.Path & "\" & strFileName
    28.    
    29.     Open strFileLocation For Output As #intFF
    30.    
    31.     With lblColorScheme
    32.         Print #intFF, .BackColor & "|" & .ForeColor
    33.     End With
    34.    
    35.     Close #intFF
    36. End Sub
    output is:
    Code:
    12615808|255

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