TypeLoadException error with custom control on service pack 2

D

dantheman

hi all,

the following code fails on pocket pc's and emulator with service pack
2 installed can any one make it work and tell me how i can make it work
please i don't no what to try any more, i've re-compiled with service
pack 2 installed on the dev box but yet it's still not working

i get the following error when i call it troughtout my code
TypeLoadException: Could not load type
System.windows.Forms.ContainerControl from Assembly
System.Windows.Forms, Version= 1.0.5000.0, Culture=Neutral,
PublicKeyToken=B77A5C561934E089

Any help would be greatly apprciated
Thankx

using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;

#region Designer
==================================================================
#if NETCFDESIGNTIME
//using System.CodeDom;
using System.ComponentModel;
//using System.ComponentModel.Design;
//using System.ComponentModel.Design.Serialization;
#endif

#if NETCFDESIGNTIME
[assembly: System.CF.Design.RuntimeAssembly("DSGroupBox,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")]
#endif

#endregion
========================================================================

namespace DSGroupBox
{
//=================================================================================
// Enums
//=================================================================================
#region Enums
=====================================================================

/*/// <summary>
/// Specifies the border style for a control.
/// </summary>
public enum BorderStyle
{
/// <summary>
/// A single-line border.
/// </summary>
FixedSingle = 0x01,
/// <summary>
/// A three-dimensional border.
/// </summary>
Fixed3D = 0x02
}*/

#endregion
========================================================================
//=================================================================================

//=================================================================================
// CustomGroupBox
//=================================================================================
#region DSGroupBox
==================================================================

/// <summary>
/// Represents a Windows group box.
/// </summary>
/// <remarks>The <b>CustomGroupBox</b> displays a frame around a group
of controls with or without a caption.
/// Use a <b>CustomGroupBox</b> to logically group a collection of
controls on a form.
/// The group box is a container control that can be used to define
groups of controls.</remarks>
/// <seealso
cref="T:System.Windows.Forms.CustomGroupBox">System.Windows.Forms.CustomGroupBox
Control</seealso>
#region Designer
==================================================================
#if NETCFDESIGNTIME
// [DesignerSerializer(typeof(CFNameDomSerializer),
typeof(CodeDomSerializer))]
#endif
#endregion
========================================================================
public class DSGroupBox : System.Windows.Forms.ContainerControl
{
//=================================================================================
// Native Support
//=================================================================================
#region Native Support
============================================================

#if !NETCFDESIGNTIME
[DllImport("coredll.dll", EntryPoint="GetCapture",
SetLastError=true)]
private static extern IntPtr GetCapture();
#endif

#endregion
========================================================================
//=================================================================================




//=================================================================================
// Fields
//=================================================================================
#region Fields
====================================================================

private int _offset = 8; // pixels
private int _space = 4; // pixels
private SolidBrush brushText;
//private Color myborderColor = Color.White;
private Color borderColor = Color.Black;

private Pen penBorderSingle = new Pen(Color.Black);
private Pen penBorder3DDark = new Pen(SystemColors.ControlDark);
private Pen penBorder3DLight = new Pen(SystemColors.ControlLight);
private BorderStyle borderStyle = BorderStyle.FixedSingle;
private IntPtr m_hWnd = IntPtr.Zero;
// private string m_name = "";


#endregion
========================================================================
//=================================================================================




//=================================================================================
// Properties
//=================================================================================
#region Properties
================================================================

#region Hidden
====================================================================



#endregion
========================================================================


/// <summary>
/// Gets or sets the border style for the control.
/// </summary>
/// <value>One of the <see
cref="T:System.Windows.Forms.BorderStyle"/> values.
/// The default is BorderStyle.FixedSingle.</value>
/// <remarks>On CE.NET devices where the intrinisic controls are
rendered with a 3D look, you should use BorderStyle.Fixed3D.
/// For Pocket PC and similar where a flat UI is used use the default
BorderStyle.FixedSingle value.
/// BorderStyle.None will not draw a border around the group. If you
are not using the Text property you should consider using the <see
cref="T:System.Windows.Forms.Panel"/> control instead.</remarks>
#region Designer
==================================================================
#if NETCFDESIGNTIME
[
Category("Appearance"),
Description("Gets or sets the border style for the control."),
DefaultValue(BorderStyle.FixedSingle)
]
#endif
#endregion
========================================================================
public virtual BorderStyle BorderStyle
{
get
{
return borderStyle;
}
set
{
if (borderStyle != value)
{
borderStyle = value;
this.Invalidate();
}
}
}


/// <summary>
/// Gets or sets the foreground color of the control.
/// </summary>
/// <value>The foreground <see cref="T:System.Drawing.Color"/> of the
control. The default is the value of the DefaultForeColor
property.</value>
#region Designer
==================================================================
#if NETCFDESIGNTIME
[
Category("Appearance"),
Description("Gets or sets the foreground color of the control.")
]
#endif
#endregion
========================================================================
public override Color ForeColor
{
get
{
return base.ForeColor;
}
set
{
if (base.ForeColor != value)
{
base.ForeColor = value;
brushText.Color = value;
this.Invalidate();
}
}
}
#region Designer
==================================================================
#if NETCFDESIGNTIME
/// <summary>
/// Indicates whether the ForeColor property should be persisted.
/// </summary>
/// <returns>true if the property value has changed from its default;
otherwise, false.</returns>
public bool ShouldSerializeForeColor()
{
return (base.ForeColor != Control.DefaultForeColor);
}

/// <summary>
/// Resets the ForeColor property to its default value.
/// </summary>
public override void ResetForeColor()
{
this.ForeColor = Control.DefaultForeColor;
}
#endif
#endregion
========================================================================

/// <summary>
/// Gets or sets the border color for the control.
/// </summary>
#region Designer
==================================================================
#if NETCFDESIGNTIME
[
Category("Appearance"),
Description("Gets or sets the border color for the control."),
]
#endif
#endregion
========================================================================
public virtual Color BorderColor
{
get { return borderColor; }
set { borderColor = value; }
}

#region Designer
==================================================================
#if !NETCFDESIGNTIME
/// <summary>
/// Gets the window handle that the control is bound to.
/// </summary>
/// <value>An IntPtr that contains the window handle (HWND) of the
control.</value>
public virtual IntPtr Handle
{
get
{
return m_hWnd;
}
}
#endif
#endregion
========================================================================


// /// <summary>
// /// Gets or sets the name of the control.
// /// </summary>
// /// <value>The name of the control. The default is an empty
string ("").</value>
// #region Designer
==================================================================
//#if NETCFDESIGNTIME
// [
// Category("Design"),
// Description("Gets or sets the name of the control."),
// DefaultValue("")
// ]
// public new string Name
//#endif
// #endregion
========================================================================
//#if !NETCFDESIGNTIME
// public virtual string Name
//#endif
// {
// get
// {
// return m_name;
// }
// set
// {
// if (m_name != value)
// {
// #region Designer
==================================================================
//#if NETCFDESIGNTIME
// base.Name = value;
//#endif
// #endregion
========================================================================
// m_name = value;
// }
// }
// }

#endregion
========================================================================
//=================================================================================




//=================================================================================
// Methods
//=================================================================================
#region Methods
===================================================================

/// <summary>
/// Initializes a new instance of the <b>CustomGroupBox</b> class.
/// </summary>
public DSGroupBox()
{
#region Designer
===============================================================
#if NETCFDESIGNTIME
this.SetStyle(ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer |
ControlStyles.ResizeRedraw, true);
#endif
#endregion
=====================================================================

brushText = new SolidBrush(base.ForeColor);

#if !NETCFDESIGNTIME
this.Capture = true;
m_hWnd = GetCapture();
this.Capture = false;
#endif
}


/// <summary>
/// Destroys this instance of the CustomGroupBox class.
/// </summary>
~DSGroupBox()
{
brushText.Dispose();
penBorderSingle.Dispose();
penBorder3DDark.Dispose();
penBorder3DLight.Dispose();
}


/// <summary>
/// Raises the Paint event.
/// </summary>
/// <param name="e">A PaintEventArgs that contains the event
data.</param>
protected override void OnPaint(System.Windows.Forms.PaintEventArgs
e)
{
SizeF sizeText = e.Graphics.MeasureString(this.Text, this.Font);

penBorderSingle.Color = borderColor;


#region Background
=============================================================

e.Graphics.Clear(this.BackColor);

#endregion
=====================================================================


#region Text
===================================================================

e.Graphics.DrawString(this.Text, this.Font, brushText, _offset +
_space, 0);

#endregion
=====================================================================


#region Border
=================================================================

switch (borderStyle)
{
case BorderStyle.None:
{
//do nothing
break;
}
case BorderStyle.FixedSingle:
{
// Top lines
e.Graphics.DrawLine(penBorderSingle, 0,
Convert.ToInt32(sizeText.Height / 2), _offset,
Convert.ToInt32(sizeText.Height / 2));
e.Graphics.DrawLine(penBorderSingle, _offset + (_space * 2) +
Convert.ToInt32(sizeText.Width), Convert.ToInt32(sizeText.Height / 2),
this.Width - 1, Convert.ToInt32(sizeText.Height / 2));

// Right line
e.Graphics.DrawLine(penBorderSingle, this.Width - 1,
Convert.ToInt32(sizeText.Height / 2), this.Width - 1, this.Height - 1);

// Bottom line
e.Graphics.DrawLine(penBorderSingle, 0, this.Height - 1,
this.Width - 1, this.Height - 1);

// Left line
e.Graphics.DrawLine(penBorderSingle, 0,
Convert.ToInt32(sizeText.Height / 2), 0, this.Height - 1);

break;
}
case BorderStyle.Fixed3D:
{
// Top lines
e.Graphics.DrawLine(penBorder3DDark, 0,
Convert.ToInt32(sizeText.Height / 2), _offset,
Convert.ToInt32(sizeText.Height / 2));
e.Graphics.DrawLine(penBorder3DLight, 1,
Convert.ToInt32(sizeText.Height / 2) + 1, _offset,
Convert.ToInt32(sizeText.Height / 2) + 1);
e.Graphics.DrawLine(penBorder3DDark, _offset + (_space * 2) +
Convert.ToInt32(sizeText.Width), Convert.ToInt32(sizeText.Height / 2),
this.Width - 2, Convert.ToInt32(sizeText.Height / 2));
e.Graphics.DrawLine(penBorder3DLight, _offset + (_space * 2) +
Convert.ToInt32(sizeText.Width), Convert.ToInt32(sizeText.Height / 2) +
1, this.Width - 3, Convert.ToInt32(sizeText.Height / 2) + 1);

// Right line
e.Graphics.DrawLine(penBorder3DDark, this.Width - 2,
Convert.ToInt32(sizeText.Height / 2), this.Width - 2, this.Height - 2);
e.Graphics.DrawLine(penBorder3DLight, this.Width - 1,
Convert.ToInt32(sizeText.Height / 2) + 1, this.Width - 1, this.Height -
1);

// Bottom line
e.Graphics.DrawLine(penBorder3DDark, 0, this.Height - 2,
this.Width - 2, this.Height - 2);
e.Graphics.DrawLine(penBorder3DLight, 1, this.Height - 1,
this.Width - 1, this.Height - 1);

// Left line
e.Graphics.DrawLine(penBorder3DDark, 0,
Convert.ToInt32(sizeText.Height / 2), 0, this.Height - 2);
e.Graphics.DrawLine(penBorder3DLight, 1,
Convert.ToInt32(sizeText.Height / 2) + 1, 1, this.Height - 3);

break;
}
}

#endregion
=====================================================================


base.OnPaint(e);
}


/// <summary>
/// Paints the background of the control. Overriden to prevent
flicker.
/// </summary>
/// <param name="e">A PaintEventArgs that contains information about
the control to paint.</param>
protected override void
OnPaintBackground(System.Windows.Forms.PaintEventArgs e)
{
// Override and do nothing to prevent flicker.
}


/// <summary>
/// Raises the Resize event.
/// </summary>
/// <param name="e">An EventArgs that contains the event
data.</param>
protected override void OnResize(System.EventArgs e)
{
this.Invalidate();
base.OnResize(e);
}


/// <summary>
/// Raises the TextChanged event.
/// </summary>
/// <param name="e">An EventArgs that contains the event
data.</param>
protected override void OnTextChanged(System.EventArgs e)
{
this.Invalidate();
base.OnTextChanged(e);
}

#endregion
========================================================================
//=================================================================================
}

#endregion
========================================================================
//=================================================================================
}
 
S

Sergey Bogdanov

Make sure that you have created the reference to CF System.Windows.Forms
but not to the Full Framework Forms. The public token with the value
B77A5C561934E089 shows that this assembly or one of its references
contain the reference to System.Windows.Forms from Full Framework (for
Compact Framework public token of System.Windows.Forms must be
969db8053d3322ac).

Best regards,
Sergey Bogdanov
http://www.sergeybogdanov.com
hi all,

the following code fails on pocket pc's and emulator with service pack
2 installed can any one make it work and tell me how i can make it work
please i don't no what to try any more, i've re-compiled with service
pack 2 installed on the dev box but yet it's still not working

i get the following error when i call it troughtout my code
TypeLoadException: Could not load type
System.windows.Forms.ContainerControl from Assembly
System.Windows.Forms, Version= 1.0.5000.0, Culture=Neutral,
PublicKeyToken=B77A5C561934E089

Any help would be greatly apprciated
Thankx

using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Windows.Forms;

#region Designer
==================================================================
#if NETCFDESIGNTIME
//using System.CodeDom;
using System.ComponentModel;
//using System.ComponentModel.Design;
//using System.ComponentModel.Design.Serialization;
#endif

#if NETCFDESIGNTIME
[assembly: System.CF.Design.RuntimeAssembly("DSGroupBox,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null")]
#endif

#endregion
========================================================================

namespace DSGroupBox
{
//=================================================================================
// Enums
//=================================================================================
#region Enums
=====================================================================

/*/// <summary>
/// Specifies the border style for a control.
/// </summary>
public enum BorderStyle
{
/// <summary>
/// A single-line border.
/// </summary>
FixedSingle = 0x01,
/// <summary>
/// A three-dimensional border.
/// </summary>
Fixed3D = 0x02
}*/

#endregion
========================================================================
//=================================================================================

//=================================================================================
// CustomGroupBox
//=================================================================================
#region DSGroupBox
==================================================================

/// <summary>
/// Represents a Windows group box.
/// </summary>
/// <remarks>The <b>CustomGroupBox</b> displays a frame around a group
of controls with or without a caption.
/// Use a <b>CustomGroupBox</b> to logically group a collection of
controls on a form.
/// The group box is a container control that can be used to define
groups of controls.</remarks>
/// <seealso
cref="T:System.Windows.Forms.CustomGroupBox">System.Windows.Forms.CustomGroupBox
Control</seealso>
#region Designer
==================================================================
#if NETCFDESIGNTIME
// [DesignerSerializer(typeof(CFNameDomSerializer),
typeof(CodeDomSerializer))]
#endif
#endregion
========================================================================
public class DSGroupBox : System.Windows.Forms.ContainerControl
{
//=================================================================================
// Native Support
//=================================================================================
#region Native Support
============================================================

#if !NETCFDESIGNTIME
[DllImport("coredll.dll", EntryPoint="GetCapture",
SetLastError=true)]
private static extern IntPtr GetCapture();
#endif

#endregion
========================================================================
//=================================================================================




//=================================================================================
// Fields
//=================================================================================
#region Fields
====================================================================

private int _offset = 8; // pixels
private int _space = 4; // pixels
private SolidBrush brushText;
//private Color myborderColor = Color.White;
private Color borderColor = Color.Black;

private Pen penBorderSingle = new Pen(Color.Black);
private Pen penBorder3DDark = new Pen(SystemColors.ControlDark);
private Pen penBorder3DLight = new Pen(SystemColors.ControlLight);
private BorderStyle borderStyle = BorderStyle.FixedSingle;
private IntPtr m_hWnd = IntPtr.Zero;
// private string m_name = "";


#endregion
========================================================================
//=================================================================================




//=================================================================================
// Properties
//=================================================================================
#region Properties
================================================================

#region Hidden
====================================================================



#endregion
========================================================================


/// <summary>
/// Gets or sets the border style for the control.
/// </summary>
/// <value>One of the <see
cref="T:System.Windows.Forms.BorderStyle"/> values.
/// The default is BorderStyle.FixedSingle.</value>
/// <remarks>On CE.NET devices where the intrinisic controls are
rendered with a 3D look, you should use BorderStyle.Fixed3D.
/// For Pocket PC and similar where a flat UI is used use the default
BorderStyle.FixedSingle value.
/// BorderStyle.None will not draw a border around the group. If you
are not using the Text property you should consider using the <see
cref="T:System.Windows.Forms.Panel"/> control instead.</remarks>
#region Designer
==================================================================
#if NETCFDESIGNTIME
[
Category("Appearance"),
Description("Gets or sets the border style for the control."),
DefaultValue(BorderStyle.FixedSingle)
]
#endif
#endregion
========================================================================
public virtual BorderStyle BorderStyle
{
get
{
return borderStyle;
}
set
{
if (borderStyle != value)
{
borderStyle = value;
this.Invalidate();
}
}
}


/// <summary>
/// Gets or sets the foreground color of the control.
/// </summary>
/// <value>The foreground <see cref="T:System.Drawing.Color"/> of the
control. The default is the value of the DefaultForeColor
property.</value>
#region Designer
==================================================================
#if NETCFDESIGNTIME
[
Category("Appearance"),
Description("Gets or sets the foreground color of the control.")
]
#endif
#endregion
========================================================================
public override Color ForeColor
{
get
{
return base.ForeColor;
}
set
{
if (base.ForeColor != value)
{
base.ForeColor = value;
brushText.Color = value;
this.Invalidate();
}
}
}
#region Designer
==================================================================
#if NETCFDESIGNTIME
/// <summary>
/// Indicates whether the ForeColor property should be persisted.
/// </summary>
/// <returns>true if the property value has changed from its default;
otherwise, false.</returns>
public bool ShouldSerializeForeColor()
{
return (base.ForeColor != Control.DefaultForeColor);
}

/// <summary>
/// Resets the ForeColor property to its default value.
/// </summary>
public override void ResetForeColor()
{
this.ForeColor = Control.DefaultForeColor;
}
#endif
#endregion
========================================================================

/// <summary>
/// Gets or sets the border color for the control.
/// </summary>
#region Designer
==================================================================
#if NETCFDESIGNTIME
[
Category("Appearance"),
Description("Gets or sets the border color for the control."),
]
#endif
#endregion
========================================================================
public virtual Color BorderColor
{
get { return borderColor; }
set { borderColor = value; }
}

#region Designer
==================================================================
#if !NETCFDESIGNTIME
/// <summary>
/// Gets the window handle that the control is bound to.
/// </summary>
/// <value>An IntPtr that contains the window handle (HWND) of the
control.</value>
public virtual IntPtr Handle
{
get
{
return m_hWnd;
}
}
#endif
#endregion
========================================================================


// /// <summary>
// /// Gets or sets the name of the control.
// /// </summary>
// /// <value>The name of the control. The default is an empty
string ("").</value>
// #region Designer
==================================================================
//#if NETCFDESIGNTIME
// [
// Category("Design"),
// Description("Gets or sets the name of the control."),
// DefaultValue("")
// ]
// public new string Name
//#endif
// #endregion
========================================================================
//#if !NETCFDESIGNTIME
// public virtual string Name
//#endif
// {
// get
// {
// return m_name;
// }
// set
// {
// if (m_name != value)
// {
// #region Designer
==================================================================
//#if NETCFDESIGNTIME
// base.Name = value;
//#endif
// #endregion
========================================================================
// m_name = value;
// }
// }
// }

#endregion
========================================================================
//=================================================================================




//=================================================================================
// Methods
//=================================================================================
#region Methods
===================================================================

/// <summary>
/// Initializes a new instance of the <b>CustomGroupBox</b> class.
/// </summary>
public DSGroupBox()
{
#region Designer
===============================================================
#if NETCFDESIGNTIME
this.SetStyle(ControlStyles.UserPaint |
ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer |
ControlStyles.ResizeRedraw, true);
#endif
#endregion
=====================================================================

brushText = new SolidBrush(base.ForeColor);

#if !NETCFDESIGNTIME
this.Capture = true;
m_hWnd = GetCapture();
this.Capture = false;
#endif
}


/// <summary>
/// Destroys this instance of the CustomGroupBox class.
/// </summary>
~DSGroupBox()
{
brushText.Dispose();
penBorderSingle.Dispose();
penBorder3DDark.Dispose();
penBorder3DLight.Dispose();
}


/// <summary>
/// Raises the Paint event.
/// </summary>
/// <param name="e">A PaintEventArgs that contains the event
data.</param>
protected override void OnPaint(System.Windows.Forms.PaintEventArgs
e)
{
SizeF sizeText = e.Graphics.MeasureString(this.Text, this.Font);

penBorderSingle.Color = borderColor;


#region Background
=============================================================

e.Graphics.Clear(this.BackColor);

#endregion
=====================================================================


#region Text
===================================================================

e.Graphics.DrawString(this.Text, this.Font, brushText, _offset +
_space, 0);

#endregion
=====================================================================


#region Border
=================================================================

switch (borderStyle)
{
case BorderStyle.None:
{
//do nothing
break;
}
case BorderStyle.FixedSingle:
{
// Top lines
e.Graphics.DrawLine(penBorderSingle, 0,
Convert.ToInt32(sizeText.Height / 2), _offset,
Convert.ToInt32(sizeText.Height / 2));
e.Graphics.DrawLine(penBorderSingle, _offset + (_space * 2) +
Convert.ToInt32(sizeText.Width), Convert.ToInt32(sizeText.Height / 2),
this.Width - 1, Convert.ToInt32(sizeText.Height / 2));

// Right line
e.Graphics.DrawLine(penBorderSingle, this.Width - 1,
Convert.ToInt32(sizeText.Height / 2), this.Width - 1, this.Height - 1);

// Bottom line
e.Graphics.DrawLine(penBorderSingle, 0, this.Height - 1,
this.Width - 1, this.Height - 1);

// Left line
e.Graphics.DrawLine(penBorderSingle, 0,
Convert.ToInt32(sizeText.Height / 2), 0, this.Height - 1);

break;
}
case BorderStyle.Fixed3D:
{
// Top lines
e.Graphics.DrawLine(penBorder3DDark, 0,
Convert.ToInt32(sizeText.Height / 2), _offset,
Convert.ToInt32(sizeText.Height / 2));
e.Graphics.DrawLine(penBorder3DLight, 1,
Convert.ToInt32(sizeText.Height / 2) + 1, _offset,
Convert.ToInt32(sizeText.Height / 2) + 1);
e.Graphics.DrawLine(penBorder3DDark, _offset + (_space * 2) +
Convert.ToInt32(sizeText.Width), Convert.ToInt32(sizeText.Height / 2),
this.Width - 2, Convert.ToInt32(sizeText.Height / 2));
e.Graphics.DrawLine(penBorder3DLight, _offset + (_space * 2) +
Convert.ToInt32(sizeText.Width), Convert.ToInt32(sizeText.Height / 2) +
1, this.Width - 3, Convert.ToInt32(sizeText.Height / 2) + 1);

// Right line
e.Graphics.DrawLine(penBorder3DDark, this.Width - 2,
Convert.ToInt32(sizeText.Height / 2), this.Width - 2, this.Height - 2);
e.Graphics.DrawLine(penBorder3DLight, this.Width - 1,
Convert.ToInt32(sizeText.Height / 2) + 1, this.Width - 1, this.Height -
1);

// Bottom line
e.Graphics.DrawLine(penBorder3DDark, 0, this.Height - 2,
this.Width - 2, this.Height - 2);
e.Graphics.DrawLine(penBorder3DLight, 1, this.Height - 1,
this.Width - 1, this.Height - 1);

// Left line
e.Graphics.DrawLine(penBorder3DDark, 0,
Convert.ToInt32(sizeText.Height / 2), 0, this.Height - 2);
e.Graphics.DrawLine(penBorder3DLight, 1,
Convert.ToInt32(sizeText.Height / 2) + 1, 1, this.Height - 3);

break;
}
}

#endregion
=====================================================================


base.OnPaint(e);
}


/// <summary>
/// Paints the background of the control. Overriden to prevent
flicker.
/// </summary>
/// <param name="e">A PaintEventArgs that contains information about
the control to paint.</param>
protected override void
OnPaintBackground(System.Windows.Forms.PaintEventArgs e)
{
// Override and do nothing to prevent flicker.
}


/// <summary>
/// Raises the Resize event.
/// </summary>
/// <param name="e">An EventArgs that contains the event
data.</param>
protected override void OnResize(System.EventArgs e)
{
this.Invalidate();
base.OnResize(e);
}


/// <summary>
/// Raises the TextChanged event.
/// </summary>
/// <param name="e">An EventArgs that contains the event
data.</param>
protected override void OnTextChanged(System.EventArgs e)
{
this.Invalidate();
base.OnTextChanged(e);
}

#endregion
========================================================================
//=================================================================================
}

#endregion
========================================================================
//=================================================================================
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top