Changeset 965
- Timestamp:
- 05/02/09 06:15:09 (4 years ago)
- File:
-
- 1 edited
-
branches/eraser6/Util/UxThemeAPI.cs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/Util/UxThemeAPI.cs
r964 r965 248 248 protected override void OnRenderArrow(ToolStripArrowRenderEventArgs e) 249 249 { 250 base.OnRenderArrow(e); 250 int itemState = (int)(e.Item.Enabled ? POPUPSUBMENUSTATES.MSM_NORMAL : 251 POPUPSUBMENUSTATES.MSM_DISABLED); 252 253 //Strangely, UxTheme won't draw any arrow once the starting coordinate 254 //is beyond 5px. So draw the arrow on a backing image then blit 255 //to the actual one. 256 using (Bitmap backBmp = new Bitmap(e.ArrowRectangle.Width, e.ArrowRectangle.Height)) 257 { 258 using (Graphics backGfx = Graphics.FromImage(backBmp)) 259 { 260 IntPtr hDC = backGfx.GetHdc(); 261 262 Rectangle backRect = new Rectangle(new Point(0, 0), backBmp.Size); 263 DrawThemeBackground(hTheme, hDC, (int)MENUPARTS.MENU_POPUPSUBMENU, itemState, 264 ref backRect, ref backRect); 265 backGfx.ReleaseHdc(); 266 } 267 268 e.Graphics.DrawImageUnscaled(backBmp, e.ArrowRectangle); 269 } 251 270 } 252 271 … … 336 355 MPI_DISABLEDHOT = 4, 337 356 } 357 358 private enum POPUPSUBMENUSTATES 359 { 360 MSM_NORMAL = 1, 361 MSM_DISABLED = 2, 362 } 338 363 #endregion 339 364 }
Note: See TracChangeset
for help on using the changeset viewer.
