Select a specific Overload in CheckboxRenderer.DrawCheckBox

64 views Asked by At

In using the CheckBoxRenderer, ComboboxRenderer, TextBoxRederer, and ButtonReder, how do you set the ForeColor(for Text Color) and BackColor (for the Rectangle Box).

'For CheckBoxRender
Dim gl As Point = GC1.Location
Dim r As Rectangle = GC1.ClientRect
Dim textrect As New Rectangle(r.Left + 1, r.Top, r.Width - 2, r.Height)
Dim s As String = GetCellString(GC1, FMT(GC1.FMTCode))
Dim fnt As Font = GetFont(GC1.Font, DefaultLabelFont)
Dim flags As TextFormatFlags = GC1.TextFormatFlag
Dim i As Image
Dim imagerect As New Rectangle(r.Left + 1, r.Top, r.Width - 2, r.Height)
Dim state As CheckBoxState = GetCheckBoxState(GC1.Enabled, GC1.CheckCellChecked, Focused)

    CheckBoxRenderer.DrawCheckBox(g, gl, textrect, s, fnt, flags, i, imagerect, Focused)

'For TextBoxRederer
            
Dim s As String = GC1.Value.ToString
Dim fnt As Font = GC1.Font
Dim r As Rectangle = GC1.ClientRect
Dim fc As Color = GC1.ForeColor
Dim bc As Color = GC1.BackColor
Dim r2 As New Rectangle(r.Left + 1, r.Top + 1, r.Width - 2, r.Height - 2)
Dim flags As TextFormatFlags = GC1.TextFormatFlag
Dim state As TextBoxState = GetTextBoxState(GC1.Enabled, Focused)
TextBoxRenderer.DrawTextBox(g, r, s, fnt, r2, flags, state)
           

0

There are 0 answers