It seems that TextBoxRenderer uses EP_BACKGROUNDWITHBORDER , while EP_EDITBORDER_NOSCROLL usually used by TextBox controls [1] .
if (VisualStyleRenderer.IsSupported) { // Use the text control focus rectangle. // EP_EDITBORDER_NOSCROLL, EPSN_FOCUSED VisualStyleElement element = VisualStyleElement.CreateElement("EDIT", 6, 3); if (VisualStyleRenderer.IsElementDefined(element)) { VisualStyleRenderer renderer = new VisualStyleRenderer(element); renderer.DrawBackground(e.Graphics, ClientRectangle); } }
(It's tempting to try to get an element from VisualStyleElement , but there is no nested class for EP_EDITBORDER_NOSCROLL . So the numeric constants 6 and 3 are.)
source share