daily pastebin goal
85%
SHARE
TWEET

Untitled

a guest May 17th, 2018 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Public Sub SetFormDefaultColors(ByRef oForm As MSForms.UserForm)
  2.     On Error GoTo ErrorHandler
  3.    
  4.     Dim oControl As MSForms.Control
  5.    
  6.     For Each oControl In oForm.Controls
  7.         Select Case TypeName(oControl)
  8.             Case "MultiPage":
  9.                 oControl.BackColor = CustomSettings.FORMS_BACKGROUND_COLOR
  10.                
  11.             Case "Frame", "Label", "RadioButton":
  12.                 oControl.BackColor = CustomSettings.FORMS_BACKGROUND_COLOR
  13.                 oControl.BorderColor = CustomSettings.FORMS_BORDER_COLOR
  14.                 oControl.ForeColor = CustomSettings.FORMS_FORE_COLOR
  15.                
  16.             Case "TextBox", "ComboBox":
  17.                 oControl.BorderColor = CustomSettings.FORMS_BORDER_COLOR
  18.                
  19.             Case "CheckBox", "OptionButton":
  20.                 oControl.ForeColor = CustomSettings.FORMS_FORE_COLOR
  21.  
  22.         End Select
  23.     Next oControl
  24.    
  25.     oForm.BackColor = CustomSettings.FORMS_BACKGROUND_COLOR
  26.    
  27.     Exit Sub
  28. ErrorHandler:
  29.     Call UI.ShowError("FormHelper.SetFormDefaultColors")
  30. End Sub
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top