73 references to ToWin32
System.Drawing (2)
commonui\System\Drawing\Advanced\ColorTranslator.cs (1)
125return ToWin32(c);
commonui\System\Drawing\Bitmap.cs (1)
422ColorTranslator.ToWin32(background));
System.Windows.Forms (70)
misc\GDI\DeviceContext2.cs (2)
81return ColorTranslator.FromWin32(IntUnsafeNativeMethods.SetBkColor( new HandleRef( this, this.Hdc ), ColorTranslator.ToWin32(newColor))); 434return ColorTranslator.FromWin32(IntUnsafeNativeMethods.SetTextColor(new HandleRef( this, this.Hdc), ColorTranslator.ToWin32(newColor)));
misc\GDI\WindowsGraphics2.cs (1)
299int colorResult = IntUnsafeNativeMethods.GetNearestColor(hdc, ColorTranslator.ToWin32(color));
misc\GDI\WindowsPen.cs (2)
121this.nativeHandle = IntSafeNativeMethods.CreatePen((int) this.style, this.width, ColorTranslator.ToWin32(this.color) ); 127lb.lbColor = ColorTranslator.ToWin32( this.wndBrush.Color );
misc\GDI\WindowsSolidBrush.cs (1)
35IntPtr nativeHandle = IntSafeNativeMethods.CreateSolidBrush(ColorTranslator.ToWin32( this.Color));
winforms\Managed\System\WinForms\ColorDialog.cs (2)
287cc.rgbResult = ColorTranslator.ToWin32(color); 298if (cc.rgbResult != ColorTranslator.ToWin32(color)) color = ColorTranslator.FromOle(cc.rgbResult);
winforms\Managed\System\WinForms\ComboBox.cs (2)
2211SafeNativeMethods.SetTextColor(new HandleRef(null, dc), ColorTranslator.ToWin32(ForeColor)); 2212SafeNativeMethods.SetBkColor(new HandleRef(null, dc), ColorTranslator.ToWin32(BackColor));
winforms\Managed\System\WinForms\Control.cs (3)
1060backBrush = SafeNativeMethods.CreateSolidBrush(ColorTranslator.ToWin32(color)); 7142SafeNativeMethods.SetTextColor(new HandleRef(null, dc), ColorTranslator.ToWin32(ForeColor)); 7143SafeNativeMethods.SetBkColor(new HandleRef(null, dc), ColorTranslator.ToWin32(BackColor));
winforms\Managed\System\WinForms\ControlPaint.cs (6)
343lb.lbColor = ColorTranslator.ToWin32(Color.Black); 1788pen = SafeNativeMethods.CreatePen(NativeMethods.PS_DOT, 1, ColorTranslator.ToWin32(backColor)); 1793pen = SafeNativeMethods.CreatePen(NativeMethods.PS_SOLID, 2, ColorTranslator.ToWin32(backColor)); 1800SafeNativeMethods.SetBkColor(new HandleRef(null, dc), ColorTranslator.ToWin32(graphicsColor)); 1827IntPtr pen = SafeNativeMethods.CreatePen(NativeMethods.PS_SOLID, 1, ColorTranslator.ToWin32(backColor)); 2008IntPtr brush = SafeNativeMethods.CreateSolidBrush(ColorTranslator.ToWin32(backColor));
winforms\Managed\System\WinForms\DateTimePicker.cs (1)
1397SendMessage(NativeMethods.DTM_SETMCCOLOR, colorIndex, ColorTranslator.ToWin32(value));
winforms\Managed\System\WinForms\Design\ComponentEditorForm.cs (6)
745savedColor = SafeNativeMethods.SetBkColor(new HandleRef(null, dc), ColorTranslator.ToWin32(SystemColors.ControlLightLight)); 756SafeNativeMethods.SetBkColor(new HandleRef(null, dc), ColorTranslator.ToWin32(SystemColors.ControlDark)); 809state, ColorTranslator.ToWin32(SystemColors.Control), ColorTranslator.ToWin32(SystemColors.ControlText)); 839oldTextColor = SafeNativeMethods.SetTextColor(new HandleRef(null, dc), ColorTranslator.ToWin32(SystemColors.ControlLightLight)); 840oldBackColor = SafeNativeMethods.SetBkColor(new HandleRef(null, dc), ColorTranslator.ToWin32(SystemColors.Control));
winforms\Managed\System\WinForms\FontDialog.cs (4)
175return ColorTranslator.FromWin32(ColorTranslator.ToWin32(color)); 594cf.rgbColors = ColorTranslator.ToWin32(color); 597cf.rgbColors = ColorTranslator.ToWin32(SystemColors.ControlText); 674if (ColorTranslator.ToWin32(color) != rgb) {
winforms\Managed\System\WinForms\Form.cs (2)
6462result = UnsafeNativeMethods.SetLayeredWindowAttributes(new HandleRef(this, Handle), ColorTranslator.ToWin32(transparencyKey), 0, NativeMethods.LWA_COLORKEY); 6465result = UnsafeNativeMethods.SetLayeredWindowAttributes(new HandleRef(this, Handle), ColorTranslator.ToWin32(transparencyKey),
winforms\Managed\System\WinForms\ListView.cs (12)
386SendMessage(NativeMethods.LVM_SETBKCOLOR, 0, ColorTranslator.ToWin32(BackColor)); 855SendMessage(NativeMethods.LVM_SETTEXTCOLOR, 0, ColorTranslator.ToWin32(ForeColor)); 2776nmcd->clrText = ColorTranslator.ToWin32(odCacheForeColor); 2780nmcd->clrText = ColorTranslator.ToWin32(riFore); 2791if (nmcd->clrText == ColorTranslator.ToWin32(SystemColors.HotTrack)) 2829nmcd->clrTextBk = ColorTranslator.ToWin32(odCacheBackColor); 2833nmcd->clrTextBk = ColorTranslator.ToWin32(riBack); 4266int color = ColorTranslator.ToWin32(BackColor); 4268SendMessage(NativeMethods.LVM_SETTEXTCOLOR,0,ColorTranslator.ToWin32(base.ForeColor)); 4551int color = ColorTranslator.ToWin32(BackColor); 4644SendMessage(NativeMethods.LVM_SETBKCOLOR, 0, ColorTranslator.ToWin32(c)); 4648SendMessage(NativeMethods.LVM_SETTEXTCOLOR, 0, ColorTranslator.ToWin32(c));
winforms\Managed\System\WinForms\MonthCalendar.cs (1)
1979SendMessage(NativeMethods.MCM_SETCOLOR, colorIndex, ColorTranslator.ToWin32(value));
winforms\Managed\System\WinForms\ProgressBar.cs (6)
453UnsafeNativeMethods.SendMessage(new HandleRef(this, Handle), NativeMethods.PBM_SETBKCOLOR, 0, ColorTranslator.ToWin32(BackColor)); 462UnsafeNativeMethods.SendMessage(new HandleRef(this, Handle), NativeMethods.PBM_SETBARCOLOR, 0, ColorTranslator.ToWin32(ForeColor)); 788UnsafeNativeMethods.SendMessage(new HandleRef(this, Handle), NativeMethods.PBM_SETBKCOLOR, 0, ColorTranslator.ToWin32(BackColor)); 789UnsafeNativeMethods.SendMessage(new HandleRef(this, Handle), NativeMethods.PBM_SETBARCOLOR, 0, ColorTranslator.ToWin32(ForeColor)); 893UnsafeNativeMethods.SendMessage(new HandleRef(this, Handle), NativeMethods.PBM_SETBARCOLOR, 0, ColorTranslator.ToWin32(ForeColor)); 894UnsafeNativeMethods.SendMessage(new HandleRef(this, Handle), NativeMethods.PBM_SETBKCOLOR, 0, ColorTranslator.ToWin32(BackColor));
winforms\Managed\System\WinForms\RichTextBox.cs (7)
1013cf.crTextColor = ColorTranslator.ToWin32(value); 1064cf2.crBackColor = ColorTranslator.ToWin32(value); 2233&& ColorTranslator.ToWin32(value) == cf.crTextColor) { 2240cf.crTextColor = ColorTranslator.ToWin32(value); 2464SendMessage(RichTextBoxConstants.EM_SETBKGNDCOLOR, 0, ColorTranslator.ToWin32(BackColor)); 2568SendMessage(RichTextBoxConstants.EM_SETBKGNDCOLOR, 0, ColorTranslator.ToWin32(BackColor)); 3303SendMessage(RichTextBoxConstants.EM_SETBKGNDCOLOR, 0, ColorTranslator.ToWin32(BackColor));
winforms\Managed\System\WinForms\ToolTip.cs (4)
225UnsafeNativeMethods.SendMessage(new HandleRef(this, Handle), NativeMethods.TTM_SETTIPBKCOLOR, ColorTranslator.ToWin32(backColor), 0); 290UnsafeNativeMethods.SendMessage(new HandleRef(this, Handle), NativeMethods.TTM_SETTIPTEXTCOLOR, ColorTranslator.ToWin32(foreColor), 0); 929UnsafeNativeMethods.SendMessage(new HandleRef(this, Handle), NativeMethods.TTM_SETTIPBKCOLOR, ColorTranslator.ToWin32(BackColor), 0); 932UnsafeNativeMethods.SendMessage(new HandleRef(this, Handle), NativeMethods.TTM_SETTIPTEXTCOLOR, ColorTranslator.ToWin32(ForeColor), 0);
winforms\Managed\System\WinForms\TreeView.cs (8)
212SendMessage(NativeMethods.TVM_SETBKCOLOR, 0, ColorTranslator.ToWin32(BackColor)); 465SendMessage(NativeMethods.TVM_SETTEXTCOLOR, 0, ColorTranslator.ToWin32(ForeColor)); 876SendMessage(NativeMethods.TVM_SETLINECOLOR, 0, ColorTranslator.ToWin32(lineColor)); 2006SendMessage(NativeMethods.TVM_SETBKCOLOR, 0, ColorTranslator.ToWin32(c)); 2010SendMessage(NativeMethods.TVM_SETTEXTCOLOR, 0, ColorTranslator.ToWin32(c)); 2014SendMessage(NativeMethods.TVM_SETLINECOLOR, 0, ColorTranslator.ToWin32(lineColor)); 2781nmcd.clrText = ColorTranslator.ToWin32(riFore); 2785nmcd.clrTextBk = ColorTranslator.ToWin32(riBack);
System.Workflow.ComponentModel (1)
AuthoringOM\Design\DesignerHelpers.cs (1)
1114IntPtr penPtr = NativeMethods.ExtCreatePen(NativeMethods.PS_COSMETIC | NativeMethods.PS_USERSTYLE | penStyle, 1, new NativeMethods.LOGBRUSH(NativeMethods.BS_SOLID, ColorTranslator.ToWin32(pen.Color), 0), 2, new int[] { 1, 1 });