home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 6 Unleashed…sional Reference Edition) / Visual_Basic_6_Unleashed_Professional_Reference_Edition_Sams_1999.iso / Source / CHAP29 / 309X3211.TXT < prev    next >
Encoding:
Text File  |  1998-05-05  |  856 b   |  38 lines

  1.  
  2. Private Sub txtKeyName_Change()
  3.  
  4. ' Check the status of the txtKeyName and
  5. ' txtSectionName fields to see if some command
  6. ' buttons can be enabled.
  7. ToggleCmdButtons
  8.  
  9. End Sub
  10.  
  11. Private Sub txtSectionName_Change()
  12.  
  13. ' Check the status of the txtKeyName and
  14. ' txtSectionName fields to see if some command
  15. ' buttons can be enabled.
  16. ToggleCmdButtons
  17.  
  18. End Sub
  19.  
  20. Private Sub ToggleCmdButtons()
  21.  
  22. ' Disable/enable certain command buttons based on
  23. ' whether or not the txtSectionName and txtKeyName
  24. ' fields are blank.
  25. If txtSectionName.Text = "" And txtKeyName.Text = "" Then
  26.     cmdRetrieve.Enabled = False
  27.     cmdAdd.Enabled = False
  28.     cmdDelete.Enabled = False
  29.     cmdUpdate.Enabled = False
  30. Else
  31.     cmdRetrieve.Enabled = True
  32.     cmdAdd.Enabled = True
  33.     cmdDelete.Enabled = True
  34.     cmdUpdate.Enabled = True
  35. End If
  36.  
  37. End Sub
  38.