+ // specify the name of the component that will use this theme
+ protected virtual string ComponentType
+
+ // save component-specific elements to xml
+ protected virtual void WriteCustomData(XmlWriter writer)
+
+ // load component-specific elements from xml
+ protected virtual void ReadCustomData(XmlNode node)
+
+
+ SaveImage(writer, "MyImageProperty", img);
+ SaveImage(writer, "MyImagePropertyAgain", img);
+ SaveImage(writer, "MyImagePropertyAndAgain", img);
+
+ [MyImageProperty]base64data[/MyImageProperty]
+ [MyImagePropertyAgain index="0"/]
+ [MyImagePropertyAndAgain index="0"/]
+
+
+ // configure c1superLabel
+ c1superLabel.AutoSize = true;
+ c1superLabel.Text =
+ "click <a href='about'><b>HERE</b></a> to see an about box.<br>" +
+ "or click <a href='time'><b>HERE</b></a> to see the current time.";
+
+ // attach event handler
+ c1superLabel.LinkClicked += new C1SuperLabelLinkClickedEventHandler(c1superLabel_LinkClicked);
+ // ...
+
+ void c1superLabel_LinkClicked(object sender, C1SuperLabelLinkClickedEventArgs e)
+ {
+ if (e.HRef == "about")
+ {
+ MessageBox.Show("About C1SuperLabel!");
+ }
+ else if (e.HRef == "time")
+ {
+ MessageBox.Show("The time is " + DateTime.Now.ToShortTimeString());
+ }
+ }
+
+
+ int GetMaximumCellWidth(int col)
+ {
+ // maximum width is unknown
+ int maxWidth = -1;
+
+ // scan all rows to find the widest content
+ for (int row = 0; row < _flex.Rows.Count; row++)
+ {
+ // get cell content
+ string text = _flex.GetDataDisplay(row, col);
+
+ // check that the cell contains html
+ if (!string.IsNullOrEmpty(text) &&
+ text.StartsWith("<html>"))
+ {
+ // measure width needed to render the Html
+ _superLabel.Text = text;
+ int width = _superLabel.Measure().Width;
+
+ // save maximum width
+ if (width > maxWidth)
+ maxWidth = width;
+ }
+ return maxWidth;
+ }
+
+
+ int GetMaximumCellHeight(int row)
+ {
+ // maximum height is unknown
+ int maxHeight = -1;
+
+ // scan all columns to find the tallest content
+ for (int col = 0; col < _flex.Cols.Count; col++)
+ {
+ // get cell content
+ string text = _flex.GetDataDisplay(row, col);
+
+ // check that the cell contains html
+ if (!string.IsNullOrEmpty(text) &&
+ text.StartsWith("<html>"))
+ {
+ // measure height needed to render the Html
+ _superLabel.Text = text;
+ int width = _flex.Cols[col].WidthDisplay;
+ int height = _superLabel.Measure(width).Height;
+
+ // save maximum height
+ if (height > maxHeight)
+ maxHeight = height;
+ }
+ return maxHeight;
+ }
+
+
+ void _flex_OwnerDrawCell(object sender, OwnerDrawCellEventArgs e)
+ {
+ // get cell content
+ string text = _flex.GetDataDisplay(e.Row, e.Col);
+
+ // check that the cell contains html
+ if (!string.IsNullOrEmpty(text) &&
+ text.StartsWith("<html>"))
+ {
+ // set label back color and content
+ _superLabel.BackColor = e.Style.BackColor;
+ _superLabel.Text = text;
+
+ // draw the Html into grid cell
+ _superLabel.DrawToGraphics(e.Graphics, e.Bounds);
+
+ // cell has been drawn
+ e.Handled = true;
+ }
+ }
+
+
+ c1SuperTooltip1.MaximumWidth = 200;
+
+
+ // configure c1superTooltip
+ c1superTooltip.HitTestVisible = true;
+ var tipText =
+ "click <a href='about'><b>HERE</b></a> to see an about box.<br>" +
+ "or click <a href='time'><b>HERE</b></a> to see the current time.";
+ c1superTooltip.SetToolTip(someControl, tipText);
+
+ // attach event handler
+ c1superTooltip.LinkClicked += c1superTooltip_LinkClicked;
+ // ...
+
+ void c1superTooltip_LinkClicked(object sender, C1SuperLabelLinkClickedEventArgs e)
+ {
+ if (e.HRef == "about")
+ {
+ MessageBox.Show("About C1SuperLabel!");
+ }
+ else if (e.HRef == "time")
+ {
+ MessageBox.Show("The time is " + DateTime.Now.ToShortTimeString());
+ }
+ }
+
+ GetReordering(linebreaks)[linebreaks[1] + 4]
+ (linebreaks[1] is the position after the last character of the
+ second line, which is also the index of the first character on the
+ third line, and adding four gets the fifth character from the left).
+ The linebreaks array must include at least one value.
+ The values must be in strictly increasing order (no duplicates)
+ between 1 and the length of the text, inclusive. The last value
+ must be the length of the text.
+ GetReordering(linebreaks)[linebreaks[1] + 4]
+ (linebreaks[1] is the position after the last character of thesecond line, which is also the index of the first character on the
+ third line, and adding four gets the fifth character from the left).
+ string.CharAt(order[0]) (Rule L2.)
+
+ uint assocLen = 0;
+ AssocQueryString(ASSOCF.ASSOCF_INIT_DEFAULTTOSTAR,ASSOCSTR.ASSOCSTR_EXECUTABLE,Path.GetExtension(OutputFileName),"open",null,ref assocLen);
+
+ For existing files, another option is FindExecutable.
+
+ 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);
+ }
+ }
+
+
+ private void c1DockingManager1_Floating(object sender, FloatingEventArgs e)
+ {
+ e.FormBorderStyle = FormBorderStyle.Sizable;
+ e.MaximizeBox = true;
+ }
+
+
+ private void c1DockingManager1_Dragged(object sender, DraggedEventArgs e)
+ {
+ switch(e.DockingTab.Dock)
+ {
+ case DockStyle.Left:
+ case DockStyle.Right:
+ c1DockingManager1.DragSizingMode = ResizingMode.Proportional;
+ break;
+ case DockStyle.Top:
+ case DockStyle.Bottom:
+ c1DockingManager1.DragSizingMode = ResizingMode.Default;
+ e.DockingTab.Height = 100;
+ break;
+ default:
+ c1DockingManager1.DragSizingMode = ResizingMode.Default;
+ break;
+ }
+ }
+
+
+ private void c1ContextMenu1_Popup(object sender, EventArgs e)
+ {
+ Control c = c1ContextMenu1.SourceControl;
+ // Copy and Find is dispayed for textBox1
+ c1CommandCopy.Visible = (c == textBox1);
+ c1CommandFind.Visible = (c == textBox1);
+ // Change Picture is dispayed for pictureBox1
+ c1CommandChangePicture.Visible = (c == pictureBox1);
+ }
+
+
+ Private Sub C1TopicBar1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles C1TopicBar1.MouseMove
+ Dim ht As C1.Win.C1Command.C1TopicBarHitTestInfo = C1TopicBar1.HitTest(e.Location)
+ Label1.Text = ht.Type.ToString()
+ If (Not IsNothing(ht.Page)) Then
+ Label2.Text = ht.Page.Text
+ Else
+ Label2.Text = ""
+ End If
+ If (Not IsNothing(ht.Link)) Then
+ Label3.Text = ht.Link.Text
+ Else
+ Label3.Text = ""
+ End If
+ End Sub
+
+
+ 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);
+ }
+ }
+
+ "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);
+
+
+ // specify the name of the component that will use this theme
+ protected virtual string ComponentType
+
+ // save component-specific elements to xml
+ protected virtual void WriteCustomData(XmlWriter writer)
+
+ // load component-specific elements from xml
+ protected virtual void ReadCustomData(XmlNode node)
+
+
+ SaveImage(writer, "MyImageProperty", img);
+ SaveImage(writer, "MyImagePropertyAgain", img);
+ SaveImage(writer, "MyImagePropertyAndAgain", img);
+
+ [MyImageProperty]base64data[/MyImageProperty]
+ [MyImagePropertyAgain index="0"/]
+ [MyImagePropertyAndAgain index="0"/]
+
+
+ // configure c1superLabel
+ c1superLabel.AutoSize = true;
+ c1superLabel.Text =
+ "click <a href='about'><b>HERE</b></a> to see an about box.<br>" +
+ "or click <a href='time'><b>HERE</b></a> to see the current time.";
+
+ // attach event handler
+ c1superLabel.LinkClicked += new C1SuperLabelLinkClickedEventHandler(c1superLabel_LinkClicked);
+ // ...
+
+ void c1superLabel_LinkClicked(object sender, C1SuperLabelLinkClickedEventArgs e)
+ {
+ if (e.HRef == "about")
+ {
+ MessageBox.Show("About C1SuperLabel!");
+ }
+ else if (e.HRef == "time")
+ {
+ MessageBox.Show("The time is " + DateTime.Now.ToShortTimeString());
+ }
+ }
+
+
+ int GetMaximumCellWidth(int col)
+ {
+ // maximum width is unknown
+ int maxWidth = -1;
+
+ // scan all rows to find the widest content
+ for (int row = 0; row < _flex.Rows.Count; row++)
+ {
+ // get cell content
+ string text = _flex.GetDataDisplay(row, col);
+
+ // check that the cell contains html
+ if (!string.IsNullOrEmpty(text) &&
+ text.StartsWith("<html>"))
+ {
+ // measure width needed to render the Html
+ _superLabel.Text = text;
+ int width = _superLabel.Measure().Width;
+
+ // save maximum width
+ if (width > maxWidth)
+ maxWidth = width;
+ }
+ return maxWidth;
+ }
+
+
+ int GetMaximumCellHeight(int row)
+ {
+ // maximum height is unknown
+ int maxHeight = -1;
+
+ // scan all columns to find the tallest content
+ for (int col = 0; col < _flex.Cols.Count; col++)
+ {
+ // get cell content
+ string text = _flex.GetDataDisplay(row, col);
+
+ // check that the cell contains html
+ if (!string.IsNullOrEmpty(text) &&
+ text.StartsWith("<html>"))
+ {
+ // measure height needed to render the Html
+ _superLabel.Text = text;
+ int width = _flex.Cols[col].WidthDisplay;
+ int height = _superLabel.Measure(width).Height;
+
+ // save maximum height
+ if (height > maxHeight)
+ maxHeight = height;
+ }
+ return maxHeight;
+ }
+
+
+ void _flex_OwnerDrawCell(object sender, OwnerDrawCellEventArgs e)
+ {
+ // get cell content
+ string text = _flex.GetDataDisplay(e.Row, e.Col);
+
+ // check that the cell contains html
+ if (!string.IsNullOrEmpty(text) &&
+ text.StartsWith("<html>"))
+ {
+ // set label back color and content
+ _superLabel.BackColor = e.Style.BackColor;
+ _superLabel.Text = text;
+
+ // draw the Html into grid cell
+ _superLabel.DrawToGraphics(e.Graphics, e.Bounds);
+
+ // cell has been drawn
+ e.Handled = true;
+ }
+ }
+
+
+ c1SuperTooltip1.MaximumWidth = 200;
+
+
+ // configure c1superTooltip
+ c1superTooltip.HitTestVisible = true;
+ var tipText =
+ "click <a href='about'><b>HERE</b></a> to see an about box.<br>" +
+ "or click <a href='time'><b>HERE</b></a> to see the current time.";
+ c1superTooltip.SetToolTip(someControl, tipText);
+
+ // attach event handler
+ c1superTooltip.LinkClicked += c1superTooltip_LinkClicked;
+ // ...
+
+ void c1superTooltip_LinkClicked(object sender, C1SuperLabelLinkClickedEventArgs e)
+ {
+ if (e.HRef == "about")
+ {
+ MessageBox.Show("About C1SuperLabel!");
+ }
+ else if (e.HRef == "time")
+ {
+ MessageBox.Show("The time is " + DateTime.Now.ToShortTimeString());
+ }
+ }
+
+ GetReordering(linebreaks)[linebreaks[1] + 4]
+ (linebreaks[1] is the position after the last character of the
+ second line, which is also the index of the first character on the
+ third line, and adding four gets the fifth character from the left).
+ The linebreaks array must include at least one value.
+ The values must be in strictly increasing order (no duplicates)
+ between 1 and the length of the text, inclusive. The last value
+ must be the length of the text.
+ GetReordering(linebreaks)[linebreaks[1] + 4]
+ (linebreaks[1] is the position after the last character of thesecond line, which is also the index of the first character on the
+ third line, and adding four gets the fifth character from the left).
+ string.CharAt(order[0]) (Rule L2.)
+
+ uint assocLen = 0;
+ AssocQueryString(ASSOCF.ASSOCF_INIT_DEFAULTTOSTAR,ASSOCSTR.ASSOCSTR_EXECUTABLE,Path.GetExtension(OutputFileName),"open",null,ref assocLen);
+
+ For existing files, another option is FindExecutable.
+
+ 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);
+ }
+ }
+
+
+ // specify the name of the component that will use this theme
+ protected virtual string ComponentType
+
+ // save component-specific elements to xml
+ protected virtual void WriteCustomData(XmlWriter writer)
+
+ // load component-specific elements from xml
+ protected virtual void ReadCustomData(XmlNode node)
+
+
+ SaveImage(writer, "MyImageProperty", img);
+ SaveImage(writer, "MyImagePropertyAgain", img);
+ SaveImage(writer, "MyImagePropertyAndAgain", img);
+
+ [MyImageProperty]base64data[/MyImageProperty]
+ [MyImagePropertyAgain index="0"/]
+ [MyImagePropertyAndAgain index="0"/]
+
+
+ // configure c1superLabel
+ c1superLabel.AutoSize = true;
+ c1superLabel.Text =
+ "click <a href='about'><b>HERE</b></a> to see an about box.<br>" +
+ "or click <a href='time'><b>HERE</b></a> to see the current time.";
+
+ // attach event handler
+ c1superLabel.LinkClicked += new C1SuperLabelLinkClickedEventHandler(c1superLabel_LinkClicked);
+ // ...
+
+ void c1superLabel_LinkClicked(object sender, C1SuperLabelLinkClickedEventArgs e)
+ {
+ if (e.HRef == "about")
+ {
+ MessageBox.Show("About C1SuperLabel!");
+ }
+ else if (e.HRef == "time")
+ {
+ MessageBox.Show("The time is " + DateTime.Now.ToShortTimeString());
+ }
+ }
+
+
+ int GetMaximumCellWidth(int col)
+ {
+ // maximum width is unknown
+ int maxWidth = -1;
+
+ // scan all rows to find the widest content
+ for (int row = 0; row < _flex.Rows.Count; row++)
+ {
+ // get cell content
+ string text = _flex.GetDataDisplay(row, col);
+
+ // check that the cell contains html
+ if (!string.IsNullOrEmpty(text) &&
+ text.StartsWith("<html>"))
+ {
+ // measure width needed to render the Html
+ _superLabel.Text = text;
+ int width = _superLabel.Measure().Width;
+
+ // save maximum width
+ if (width > maxWidth)
+ maxWidth = width;
+ }
+ return maxWidth;
+ }
+
+
+ int GetMaximumCellHeight(int row)
+ {
+ // maximum height is unknown
+ int maxHeight = -1;
+
+ // scan all columns to find the tallest content
+ for (int col = 0; col < _flex.Cols.Count; col++)
+ {
+ // get cell content
+ string text = _flex.GetDataDisplay(row, col);
+
+ // check that the cell contains html
+ if (!string.IsNullOrEmpty(text) &&
+ text.StartsWith("<html>"))
+ {
+ // measure height needed to render the Html
+ _superLabel.Text = text;
+ int width = _flex.Cols[col].WidthDisplay;
+ int height = _superLabel.Measure(width).Height;
+
+ // save maximum height
+ if (height > maxHeight)
+ maxHeight = height;
+ }
+ return maxHeight;
+ }
+
+
+ void _flex_OwnerDrawCell(object sender, OwnerDrawCellEventArgs e)
+ {
+ // get cell content
+ string text = _flex.GetDataDisplay(e.Row, e.Col);
+
+ // check that the cell contains html
+ if (!string.IsNullOrEmpty(text) &&
+ text.StartsWith("<html>"))
+ {
+ // set label back color and content
+ _superLabel.BackColor = e.Style.BackColor;
+ _superLabel.Text = text;
+
+ // draw the Html into grid cell
+ _superLabel.DrawToGraphics(e.Graphics, e.Bounds);
+
+ // cell has been drawn
+ e.Handled = true;
+ }
+ }
+
+
+ c1SuperTooltip1.MaximumWidth = 200;
+
+
+ // configure c1superTooltip
+ c1superTooltip.HitTestVisible = true;
+ var tipText =
+ "click <a href='about'><b>HERE</b></a> to see an about box.<br>" +
+ "or click <a href='time'><b>HERE</b></a> to see the current time.";
+ c1superTooltip.SetToolTip(someControl, tipText);
+
+ // attach event handler
+ c1superTooltip.LinkClicked += c1superTooltip_LinkClicked;
+ // ...
+
+ void c1superTooltip_LinkClicked(object sender, C1SuperLabelLinkClickedEventArgs e)
+ {
+ if (e.HRef == "about")
+ {
+ MessageBox.Show("About C1SuperLabel!");
+ }
+ else if (e.HRef == "time")
+ {
+ MessageBox.Show("The time is " + DateTime.Now.ToShortTimeString());
+ }
+ }
+
+ GetReordering(linebreaks)[linebreaks[1] + 4]
+ (linebreaks[1] is the position after the last character of the
+ second line, which is also the index of the first character on the
+ third line, and adding four gets the fifth character from the left).
+ The linebreaks array must include at least one value.
+ The values must be in strictly increasing order (no duplicates)
+ between 1 and the length of the text, inclusive. The last value
+ must be the length of the text.
+ GetReordering(linebreaks)[linebreaks[1] + 4]
+ (linebreaks[1] is the position after the last character of thesecond line, which is also the index of the first character on the
+ third line, and adding four gets the fifth character from the left).
+ string.CharAt(order[0]) (Rule L2.)
+
+ uint assocLen = 0;
+ AssocQueryString(ASSOCF.ASSOCF_INIT_DEFAULTTOSTAR,ASSOCSTR.ASSOCSTR_EXECUTABLE,Path.GetExtension(OutputFileName),"open",null,ref assocLen);
+
+ For existing files, another option is FindExecutable.
+
+ 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);
+ }
+ }
+
+
+ ILicenseData{C1Product} _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);
+ }
+ }
+
+ GetReordering(linebreaks)[linebreaks[1] + 4]
+ (linebreaks[1] is the position after the last character of the
+ second line, which is also the index of the first character on the
+ third line, and adding four gets the fifth character from the left).
+ The linebreaks array must include at least one value.
+ The values must be in strictly increasing order (no duplicates)
+ between 1 and the length of the text, inclusive. The last value
+ must be the length of the text.
+ GetReordering(linebreaks)[linebreaks[1] + 4]
+ (linebreaks[1] is the position after the last character of thesecond line, which is also the index of the first character on the
+ third line, and adding four gets the fifth character from the left).
+ string.CharAt(order[0]) (Rule L2.)
+
+ uint assocLen = 0;
+ AssocQueryString(ASSOCF.ASSOCF_INIT_DEFAULTTOSTAR,ASSOCSTR.ASSOCSTR_EXECUTABLE,Path.GetExtension(OutputFileName),"open",null,ref assocLen);
+
+ For existing files, another option is FindExecutable.
+
+ // specify the name of the component that will use this theme
+ protected virtual string ComponentType
+
+ // save component-specific elements to xml
+ protected virtual void WriteCustomData(XmlWriter writer)
+
+ // load component-specific elements from xml
+ protected virtual void ReadCustomData(XmlNode node)
+
+
+ SaveImage(writer, "MyImageProperty", img);
+ SaveImage(writer, "MyImagePropertyAgain", img);
+ SaveImage(writer, "MyImagePropertyAndAgain", img);
+
+ [MyImageProperty]base64data[/MyImageProperty]
+ [MyImagePropertyAgain index="0"/]
+ [MyImagePropertyAndAgain index="0"/]
+
+
+ // configure c1superLabel
+ c1superLabel.AutoSize = true;
+ c1superLabel.Text =
+ "click <a href='about'><b>HERE</b></a> to see an about box.<br>" +
+ "or click <a href='time'><b>HERE</b></a> to see the current time.";
+
+ // attach event handler
+ c1superLabel.LinkClicked += new C1SuperLabelLinkClickedEventHandler(c1superLabel_LinkClicked);
+ // ...
+
+ void c1superLabel_LinkClicked(object sender, C1SuperLabelLinkClickedEventArgs e)
+ {
+ if (e.HRef == "about")
+ {
+ MessageBox.Show("About C1SuperLabel!");
+ }
+ else if (e.HRef == "time")
+ {
+ MessageBox.Show("The time is " + DateTime.Now.ToShortTimeString());
+ }
+ }
+
+
+ int GetMaximumCellWidth(int col)
+ {
+ // maximum width is unknown
+ int maxWidth = -1;
+
+ // scan all rows to find the widest content
+ for (int row = 0; row < _flex.Rows.Count; row++)
+ {
+ // get cell content
+ string text = _flex.GetDataDisplay(row, col);
+
+ // check that the cell contains html
+ if (!string.IsNullOrEmpty(text) &&
+ text.StartsWith("<html>"))
+ {
+ // measure width needed to render the Html
+ _superLabel.Text = text;
+ int width = _superLabel.Measure().Width;
+
+ // save maximum width
+ if (width > maxWidth)
+ maxWidth = width;
+ }
+ return maxWidth;
+ }
+
+
+ int GetMaximumCellHeight(int row)
+ {
+ // maximum height is unknown
+ int maxHeight = -1;
+
+ // scan all columns to find the tallest content
+ for (int col = 0; col < _flex.Cols.Count; col++)
+ {
+ // get cell content
+ string text = _flex.GetDataDisplay(row, col);
+
+ // check that the cell contains html
+ if (!string.IsNullOrEmpty(text) &&
+ text.StartsWith("<html>"))
+ {
+ // measure height needed to render the Html
+ _superLabel.Text = text;
+ int width = _flex.Cols[col].WidthDisplay;
+ int height = _superLabel.Measure(width).Height;
+
+ // save maximum height
+ if (height > maxHeight)
+ maxHeight = height;
+ }
+ return maxHeight;
+ }
+
+
+ void _flex_OwnerDrawCell(object sender, OwnerDrawCellEventArgs e)
+ {
+ // get cell content
+ string text = _flex.GetDataDisplay(e.Row, e.Col);
+
+ // check that the cell contains html
+ if (!string.IsNullOrEmpty(text) &&
+ text.StartsWith("<html>"))
+ {
+ // set label back color and content
+ _superLabel.BackColor = e.Style.BackColor;
+ _superLabel.Text = text;
+
+ // draw the Html into grid cell
+ _superLabel.DrawToGraphics(e.Graphics, e.Bounds);
+
+ // cell has been drawn
+ e.Handled = true;
+ }
+ }
+
+
+ c1SuperTooltip1.MaximumWidth = 200;
+
+
+ // configure c1superTooltip
+ c1superTooltip.HitTestVisible = true;
+ var tipText =
+ "click <a href='about'><b>HERE</b></a> to see an about box.<br>" +
+ "or click <a href='time'><b>HERE</b></a> to see the current time.";
+ c1superTooltip.SetToolTip(someControl, tipText);
+
+ // attach event handler
+ c1superTooltip.LinkClicked += c1superTooltip_LinkClicked;
+ // ...
+
+ void c1superTooltip_LinkClicked(object sender, C1SuperLabelLinkClickedEventArgs e)
+ {
+ if (e.HRef == "about")
+ {
+ MessageBox.Show("About C1SuperLabel!");
+ }
+ else if (e.HRef == "time")
+ {
+ MessageBox.Show("The time is " + DateTime.Now.ToShortTimeString());
+ }
+ }
+
+
+ ILicenseData{C1Product} _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);
+ }
+ }
+
+ GetReordering(linebreaks)[linebreaks[1] + 4]
+ (linebreaks[1] is the position after the last character of the
+ second line, which is also the index of the first character on the
+ third line, and adding four gets the fifth character from the left).
+ The linebreaks array must include at least one value.
+ The values must be in strictly increasing order (no duplicates)
+ between 1 and the length of the text, inclusive. The last value
+ must be the length of the text.
+ GetReordering(linebreaks)[linebreaks[1] + 4]
+ (linebreaks[1] is the position after the last character of thesecond line, which is also the index of the first character on the
+ third line, and adding four gets the fifth character from the left).
+ string.CharAt(order[0]) (Rule L2.)
+
+ uint assocLen = 0;
+ AssocQueryString(ASSOCF.ASSOCF_INIT_DEFAULTTOSTAR,ASSOCSTR.ASSOCSTR_EXECUTABLE,Path.GetExtension(OutputFileName),"open",null,ref assocLen);
+
+ For existing files, another option is FindExecutable.
+
+ // specify the name of the component that will use this theme
+ protected virtual string ComponentType
+
+ // save component-specific elements to xml
+ protected virtual void WriteCustomData(XmlWriter writer)
+
+ // load component-specific elements from xml
+ protected virtual void ReadCustomData(XmlNode node)
+
+
+ SaveImage(writer, "MyImageProperty", img);
+ SaveImage(writer, "MyImagePropertyAgain", img);
+ SaveImage(writer, "MyImagePropertyAndAgain", img);
+
+ [MyImageProperty]base64data[/MyImageProperty]
+ [MyImagePropertyAgain index="0"/]
+ [MyImagePropertyAndAgain index="0"/]
+
+
+ // configure c1superLabel
+ c1superLabel.AutoSize = true;
+ c1superLabel.Text =
+ "click <a href='about'><b>HERE</b></a> to see an about box.<br>" +
+ "or click <a href='time'><b>HERE</b></a> to see the current time.";
+
+ // attach event handler
+ c1superLabel.LinkClicked += new C1SuperLabelLinkClickedEventHandler(c1superLabel_LinkClicked);
+ // ...
+
+ void c1superLabel_LinkClicked(object sender, C1SuperLabelLinkClickedEventArgs e)
+ {
+ if (e.HRef == "about")
+ {
+ MessageBox.Show("About C1SuperLabel!");
+ }
+ else if (e.HRef == "time")
+ {
+ MessageBox.Show("The time is " + DateTime.Now.ToShortTimeString());
+ }
+ }
+
+
+ int GetMaximumCellWidth(int col)
+ {
+ // maximum width is unknown
+ int maxWidth = -1;
+
+ // scan all rows to find the widest content
+ for (int row = 0; row < _flex.Rows.Count; row++)
+ {
+ // get cell content
+ string text = _flex.GetDataDisplay(row, col);
+
+ // check that the cell contains html
+ if (!string.IsNullOrEmpty(text) &&
+ text.StartsWith("<html>"))
+ {
+ // measure width needed to render the Html
+ _superLabel.Text = text;
+ int width = _superLabel.Measure().Width;
+
+ // save maximum width
+ if (width > maxWidth)
+ maxWidth = width;
+ }
+ return maxWidth;
+ }
+
+
+ int GetMaximumCellHeight(int row)
+ {
+ // maximum height is unknown
+ int maxHeight = -1;
+
+ // scan all columns to find the tallest content
+ for (int col = 0; col < _flex.Cols.Count; col++)
+ {
+ // get cell content
+ string text = _flex.GetDataDisplay(row, col);
+
+ // check that the cell contains html
+ if (!string.IsNullOrEmpty(text) &&
+ text.StartsWith("<html>"))
+ {
+ // measure height needed to render the Html
+ _superLabel.Text = text;
+ int width = _flex.Cols[col].WidthDisplay;
+ int height = _superLabel.Measure(width).Height;
+
+ // save maximum height
+ if (height > maxHeight)
+ maxHeight = height;
+ }
+ return maxHeight;
+ }
+
+
+ void _flex_OwnerDrawCell(object sender, OwnerDrawCellEventArgs e)
+ {
+ // get cell content
+ string text = _flex.GetDataDisplay(e.Row, e.Col);
+
+ // check that the cell contains html
+ if (!string.IsNullOrEmpty(text) &&
+ text.StartsWith("<html>"))
+ {
+ // set label back color and content
+ _superLabel.BackColor = e.Style.BackColor;
+ _superLabel.Text = text;
+
+ // draw the Html into grid cell
+ _superLabel.DrawToGraphics(e.Graphics, e.Bounds);
+
+ // cell has been drawn
+ e.Handled = true;
+ }
+ }
+
+
+ c1SuperTooltip1.MaximumWidth = 200;
+
+
+ // configure c1superTooltip
+ c1superTooltip.HitTestVisible = true;
+ var tipText =
+ "click <a href='about'><b>HERE</b></a> to see an about box.<br>" +
+ "or click <a href='time'><b>HERE</b></a> to see the current time.";
+ c1superTooltip.SetToolTip(someControl, tipText);
+
+ // attach event handler
+ c1superTooltip.LinkClicked += c1superTooltip_LinkClicked;
+ // ...
+
+ void c1superTooltip_LinkClicked(object sender, C1SuperLabelLinkClickedEventArgs e)
+ {
+ if (e.HRef == "about")
+ {
+ MessageBox.Show("About C1SuperLabel!");
+ }
+ else if (e.HRef == "time")
+ {
+ MessageBox.Show("The time is " + DateTime.Now.ToShortTimeString());
+ }
+ }
+
+
+ private void c1DockingManager1_Floating(object sender, FloatingEventArgs e)
+ {
+ e.FormBorderStyle = FormBorderStyle.Sizable;
+ e.MaximizeBox = true;
+ }
+
+
+ private void c1DockingManager1_Dragged(object sender, DraggedEventArgs e)
+ {
+ switch(e.DockingTab.Dock)
+ {
+ case DockStyle.Left:
+ case DockStyle.Right:
+ c1DockingManager1.DragSizingMode = ResizingMode.Proportional;
+ break;
+ case DockStyle.Top:
+ case DockStyle.Bottom:
+ c1DockingManager1.DragSizingMode = ResizingMode.Default;
+ e.DockingTab.Height = 100;
+ break;
+ default:
+ c1DockingManager1.DragSizingMode = ResizingMode.Default;
+ break;
+ }
+ }
+
+
+ private void c1ContextMenu1_Popup(object sender, EventArgs e)
+ {
+ Control c = c1ContextMenu1.SourceControl;
+ // Copy and Find is dispayed for textBox1
+ c1CommandCopy.Visible = (c == textBox1);
+ c1CommandFind.Visible = (c == textBox1);
+ // Change Picture is dispayed for pictureBox1
+ c1CommandChangePicture.Visible = (c == pictureBox1);
+ }
+
+
+ Private Sub C1TopicBar1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles C1TopicBar1.MouseMove
+ Dim ht As C1.Win.C1Command.C1TopicBarHitTestInfo = C1TopicBar1.HitTest(e.Location)
+ Label1.Text = ht.Type.ToString()
+ If (Not IsNothing(ht.Page)) Then
+ Label2.Text = ht.Page.Text
+ Else
+ Label2.Text = ""
+ End If
+ If (Not IsNothing(ht.Link)) Then
+ Label3.Text = ht.Link.Text
+ Else
+ Label3.Text = ""
+ End If
+ End Sub
+
+
+ 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);
+ }
+ }
+
+
+ private void c1DockingManager1_Floating(object sender, FloatingEventArgs e)
+ {
+ e.FormBorderStyle = FormBorderStyle.Sizable;
+ e.MaximizeBox = true;
+ }
+
+
+ private void c1DockingManager1_Dragged(object sender, DraggedEventArgs e)
+ {
+ switch(e.DockingTab.Dock)
+ {
+ case DockStyle.Left:
+ case DockStyle.Right:
+ c1DockingManager1.DragSizingMode = ResizingMode.Proportional;
+ break;
+ case DockStyle.Top:
+ case DockStyle.Bottom:
+ c1DockingManager1.DragSizingMode = ResizingMode.Default;
+ e.DockingTab.Height = 100;
+ break;
+ default:
+ c1DockingManager1.DragSizingMode = ResizingMode.Default;
+ break;
+ }
+ }
+
+
+ private void c1ContextMenu1_Popup(object sender, EventArgs e)
+ {
+ Control c = c1ContextMenu1.SourceControl;
+ // Copy and Find is dispayed for textBox1
+ c1CommandCopy.Visible = (c == textBox1);
+ c1CommandFind.Visible = (c == textBox1);
+ // Change Picture is dispayed for pictureBox1
+ c1CommandChangePicture.Visible = (c == pictureBox1);
+ }
+
+
+ Private Sub C1TopicBar1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles C1TopicBar1.MouseMove
+ Dim ht As C1.Win.C1Command.C1TopicBarHitTestInfo = C1TopicBar1.HitTest(e.Location)
+ Label1.Text = ht.Type.ToString()
+ If (Not IsNothing(ht.Page)) Then
+ Label2.Text = ht.Page.Text
+ Else
+ Label2.Text = ""
+ End If
+ If (Not IsNothing(ht.Link)) Then
+ Label3.Text = ht.Link.Text
+ Else
+ Label3.Text = ""
+ End If
+ End Sub
+
+
+ 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);
+ }
+ }
+
+ "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);
+
+ "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);
+
+