|
4 | 4 |
|
5 | 5 | using System.Drawing; |
6 | 6 | using System.Windows.Forms.Layout; |
7 | | -using static Interop; |
8 | | -using static Interop.User32; |
9 | 7 |
|
10 | 8 | namespace System.Windows.Forms |
11 | 9 | { |
@@ -185,48 +183,6 @@ protected virtual Color GetPopupOuterBorderColor(ComboBox comboBox, bool focused |
185 | 183 |
|
186 | 184 | protected virtual Color GetInnerBorderColor(ComboBox comboBox) |
187 | 185 | => comboBox.Enabled ? comboBox.BackColor : SystemColors.Control; |
188 | | - |
189 | | - /// <summary> |
190 | | - /// This eliminates flicker by removing the pieces we're going to paint ourselves from the update region. |
191 | | - /// Note the UpdateRegionBox is the bounding box of the actual update region. This is here so we can |
192 | | - /// quickly eliminate rectangles that aren't in the update region. |
193 | | - /// </summary> |
194 | | - public unsafe void ValidateOwnerDrawRegions(ComboBox comboBox, Rectangle updateRegionBox) |
195 | | - { |
196 | | - if (comboBox is null) |
197 | | - { |
198 | | - return; |
199 | | - } |
200 | | - |
201 | | - Rectangle topOwnerDrawArea = new Rectangle(0, 0, comboBox.Width, _innerBorder.Top); |
202 | | - Rectangle bottomOwnerDrawArea = new Rectangle(0, _innerBorder.Bottom, comboBox.Width, comboBox.Height - _innerBorder.Bottom); |
203 | | - Rectangle leftOwnerDrawArea = new Rectangle(0, 0, _innerBorder.Left, comboBox.Height); |
204 | | - Rectangle rightOwnerDrawArea = new Rectangle(_innerBorder.Right, 0, comboBox.Width - _innerBorder.Right, comboBox.Height); |
205 | | - |
206 | | - if (topOwnerDrawArea.IntersectsWith(updateRegionBox)) |
207 | | - { |
208 | | - RECT validRect = new RECT(topOwnerDrawArea); |
209 | | - ValidateRect(comboBox, &validRect); |
210 | | - } |
211 | | - |
212 | | - if (bottomOwnerDrawArea.IntersectsWith(updateRegionBox)) |
213 | | - { |
214 | | - RECT validRect = new RECT(bottomOwnerDrawArea); |
215 | | - ValidateRect(comboBox, &validRect); |
216 | | - } |
217 | | - |
218 | | - if (leftOwnerDrawArea.IntersectsWith(updateRegionBox)) |
219 | | - { |
220 | | - RECT validRect = new RECT(leftOwnerDrawArea); |
221 | | - ValidateRect(comboBox, &validRect); |
222 | | - } |
223 | | - |
224 | | - if (rightOwnerDrawArea.IntersectsWith(updateRegionBox)) |
225 | | - { |
226 | | - RECT validRect = new RECT(rightOwnerDrawArea); |
227 | | - ValidateRect(comboBox, &validRect); |
228 | | - } |
229 | | - } |
230 | 186 | } |
231 | 187 | } |
232 | 188 | } |
0 commit comments