private static void formatToolStripMenuItem( string ip_str_form_name, IControlerControl i_objControlerControl, System.Windows.Forms.ToolStripMenuItem ip_obj_toolstripMenuItem) { if (i_objControlerControl.CanUseControl(ip_str_form_name, ip_obj_toolstripMenuItem.Name, "") == false) { //v_obj_tool_strip.Visible = False ip_obj_toolstripMenuItem.Enabled = false; } else { ToolStripMenuItem v_obj_tool_strip = default(ToolStripMenuItem); foreach (ToolStripMenuItem tempLoopVar_v_obj_tool_strip in ip_obj_toolstripMenuItem.DropDownItems) { v_obj_tool_strip = tempLoopVar_v_obj_tool_strip; formatToolStripMenuItem(ip_str_form_name, i_objControlerControl, v_obj_tool_strip); } } }
private static void formatControlInForms( string ip_str_form_name, IControlerControl i_objControlerControl, System.Windows.Forms.Control ip_control) { //If (ip_control.ToString().IndexOf("SIS.Controls.Button.SiSButton") >= 0) Then // If (i_objControlerControl.CanUseControl(ip_str_form_name, ip_control.Name, "") = False) Then // ip_control.Visible = False // ip_control.Enabled = False // End If //End If if (ip_control is Label) { ip_control.Font = getRegularFont(); ip_control.ForeColor = getSpecialForeColor(); ip_control.BackColor = getRegularBackColor(); } else if (ip_control is TextBox) { ip_control.Font = getRegularFont(); ip_control.ForeColor = getRegularForeColor(); } else if (ip_control is GroupBox) { ip_control.Font = getBoldFont(); ip_control.ForeColor = getSpecialForeColor(); ip_control.BackColor = getRegularBackColor(); } else if (ip_control is ComboBox) { ip_control.Font = getRegularFont(); ip_control.ForeColor = getRegularForeColor(); } else if (ip_control is CheckBox) { ip_control.Font = getRegularFont(); ip_control.ForeColor = getRegularForeColor(); } else if (ip_control is DateTimePicker) { ip_control.Font = getRegularFont(); ip_control.ForeColor = getRegularForeColor(); } else if (ip_control is Button) { ip_control.Font = getBoldFont(); ip_control.ForeColor = getSpecialForeColor(); if (i_objControlerControl.CanUseControl(ip_str_form_name, ip_control.Name, "") == false) { ip_control.Visible = false; ip_control.Enabled = false; } } else if (ip_control is DateTimePicker) { ((DateTimePicker) ip_control).CalendarForeColor = getRegularForeColor(); ((DateTimePicker) ip_control).CalendarTitleForeColor = getRegularForeColor(); ((DateTimePicker) ip_control).CalendarTrailingForeColor = getRegularForeColor(); } else if (ip_control is MenuStrip) { ToolStripMenuItem v_obj_tool_strip = default(ToolStripMenuItem); foreach (ToolStripMenuItem tempLoopVar_v_obj_tool_strip in ((MenuStrip) ip_control).Items) { v_obj_tool_strip = tempLoopVar_v_obj_tool_strip; formatToolStripMenuItem(ip_str_form_name, i_objControlerControl, v_obj_tool_strip); } } if (ip_control is TabControl) { ip_control.Font = getRegularFont(); ip_control.ForeColor = getRegularForeColor(); } System.Windows.Forms.Control v_control = default(System.Windows.Forms.Control); foreach (System.Windows.Forms.Control tempLoopVar_v_control in ip_control.Controls) { v_control = tempLoopVar_v_control; formatControlInForms(ip_str_form_name, i_objControlerControl, v_control); } }