"System.Reflection.Assembly.GetCallingAssembly()".
C1ComboBox comboBox = new C1ComboBox();
comboBox.AutoCompleteMode = AutoCompleteMode.Suggest;
comboBox.AutoCompleteSource = AutoCompleteSource.ListItems;
comboBox.AutoSuggestMode = AutoSuggestMode.Contains;
comboBox.Items.AddRange(new string[]
{
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
});
c1DateEdit1.Calendar.CalendarDimensions = new Size(3, 1);
// Display current month at the center of the calendar.
// Other possible values:
// 0 - (Default) - at the Right
// 1 - Center
// 2 - Left
c1DateEdit1.Calendar.CurrentMonthDisplayOffset = 1;
private void c1DateEdit1_Calendar_MonthChanged(object sender, EventArgs e)
{
DateTime dt = c1DateEdit1.Calendar.FirstMonth;
c1DateEdit1.Calendar.AddBoldedDate(new DateTime(dt.Year, dt.Month, dt.Month));
}
private void c1TextBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (CharHelper.IsKatakana(e.KeyChar))
e.KeyChar = CharHelper.ToHiragana(e.KeyChar);
}
private AmbientPropertyMonitor __ambientVisualStyleMonitor = null;
...
ctor() {
__ambientVisualStyleMonitor = new AmbientPropertyMonitor(this, "VisualStyle");
...
}
public VisualStyle VisualStyle {
get { ... }
set { ... }
}
protected void ResetVisualStyle() {
...
__ambientVisualStyleMonitor.ResetValue();
}
private AmbientPropertyMonitor __ambientVisualStyleMonitor = null;
...
ctor() {
__ambientVisualStyleMonitor = new AmbientPropertyMonitor(this, "VisualStyle");
...
}
public VisualStyle VisualStyle {
get { ... }
set { ... }
}
protected bool ShouldSerializeVisualStyle() {
if (__ambientVisualStyleMonitor.IsValueAmbient)
return false;
...
}
private AmbientPropertyMonitor __ambientVisualStyleMonitor = null;
...
ctor() {
__ambientVisualStyleMonitor = new AmbientPropertyMonitor(this, "VisualStyle");
...
}
public VisualStyle VisualStyle {
get { ... }
set { ... }
}
protected void ResetVisualStyle() {
...
__ambientVisualStyleMonitor.ResetValue();
}
private AmbientPropertyMonitor __ambientVisualStyleMonitor = null;
...
ctor() {
__ambientVisualStyleMonitor = new AmbientPropertyMonitor(this, "VisualStyle");
...
}
public VisualStyle VisualStyle {
get { ... }
set { ... }
}
protected bool ShouldSerializeVisualStyle() {
if (__ambientVisualStyleMonitor.IsValueAmbient)
return false;
...
}
LicenseInfo _licInfo;
public LicensedControl()
{
// check license but don't nag yet
_licInfo = ProviderInfo.Validate(typeof(LicensedControl), this, false);
// perform licensing after control is fully loaded
Loaded += LicensedControl_Loaded;
}
void LicensedControl_Loaded(object sender, RoutedEventArgs e)
{
// nag after loading
if (_licInfo.ShouldNag)
{
ProviderInfo.ShowAboutBox(this);
}
}
EnumHelper.IsValid(0x5f, 0x0f, 0x100, 8);
In this scenario, the four parameter is 8, because the max value is 0x100(Binary as 100000000),
the max bits on value is 0xff (Binary as 11111111), it's the max number of bits on
//
// Paints a rectangle that is single black border and filled with white.
//
using (Pen pen = new SolidPen(Color.Black))
{
using (Brush brush = new SolidBrush(Color.Wheat))
{
DeviceContext dc = DeviceContext.Screen;
IntPtr defaultPenHandle = dc.SelectObject(pen.Handle);
IntPtr defaultBrushHandle = dc.SelectObject(brush.Handle);
dc.PaintRectangle(new Rectangle(0, 0, 100, 100));
dc.SelectObject(defaultPenHandle);
dc.SelectObject(defaultBrushHandle);
}
}
| M11, M12, 0 |
| M21, M22, 0 |
| Dx, Dy, 1 |
Font newFont = new Font(templateFont, newSize);
public class TestForm : Form
{
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
IntPtr hDc = e.Graphics.GetHdc();
// create a font from default Form.Font (Microsoft Sans Serif, 8.25pt), size = 8.25
Gdi.Font font = new Gdi.Font(this.Font);
IntPtr oldFont = SelectObject(hDc, font.Handle);
string test1 = "1. This is drawing by GDI with GdiFont";
TextOut(hDc, 50, 50, test1, test1.Length);
SelectObject(hDc, oldFont);
// here I want to a font which size is as twice as current's
Drawing.Gdi.Font font2 = new Drawing.Gdi.Font(font, 2 * font.Size);
oldFont = SelectObject(hDc, font2.Handle);
string test2 = "2. This is drawing by GDI with GdiFont";
TextOut(hDc, 50, 100, test2, test2.Length);
font.Dispose();
font2.Dispose();
SelectObject(hDc, oldFont);
e.Graphics.ReleaseHdc(hDc);
}
[DllImport("gdi32.dll", EntryPoint = "SelectObject")]
public static extern IntPtr SelectObject(
IntPtr hdc,
IntPtr hObject
);
[DllImport("gdi32.dll", EntryPoint = "TextOut")]
public static extern int TextOut(
IntPtr hdc,
int x,
int y,
string lpString,
int nCount
);
}
When this value is used, the rotation for all fonts depends on whether the orientation of the coordinate system is left-handed or right-handed.
If not used, device fonts always rotate counterclockwise, but the rotation of other fonts is dependent on the orientation of the coordinate system.
bool isClipEmpty = (graphics.ClipBound == Rectangle.Empty);