A
Alvaro
Good day;
I have this one problem;
I declared struct "myNumber", and in a UserControl "MyControl".
I declared a property myNumber named "NumberComposition", desire that in
the properties palette of the created controls of MyControl type me
appear the property in the same way as they appear the Font, Location or
Size properties.
That I must do?
To see I cosay
The code is:
___________________________________________________________________
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
namespace My.Windows.Controls
{
public struct myNumber {
public readonly Int32 Precision;
public readonly Int32 Scale;
public Number(Int32 precision,Int32 scale ){
Precision = precision;
Scale = scale;
}
}
/// <summary>
/// Descripción breve de Mycon.
/// </summary>
public class MyControl: System.Windows.Forms.UserControl
{
/// <summary>
/// Variable del diseñador requerida.
/// </summary>
private System.ComponentModel.Container components = null;
private myNumber _numbercomposition = new Number(13,0);
public MyControl()
{
// Llamada necesaria para el Diseñador de formularios Windows.Forms.
InitializeComponent();
// TODO: agregar cualquier inicialización después de llamar a
InitializeComponent
}
public myNumber NumberComposition{
get{
return this._numbercomposition;
}
set{
if (this._numbercomposition.ToString() == value.ToString())
return;
this._numbercomposition = value;
if(this.NumberType == NumericType.Integer &&
this._numbercomposition.Scale > 0 )
MessageBox.Show("Value error");
}
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
#endregion
}
}
I have this one problem;
I declared struct "myNumber", and in a UserControl "MyControl".
I declared a property myNumber named "NumberComposition", desire that in
the properties palette of the created controls of MyControl type me
appear the property in the same way as they appear the Font, Location or
Size properties.
That I must do?
To see I cosay
The code is:
___________________________________________________________________
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
namespace My.Windows.Controls
{
public struct myNumber {
public readonly Int32 Precision;
public readonly Int32 Scale;
public Number(Int32 precision,Int32 scale ){
Precision = precision;
Scale = scale;
}
}
/// <summary>
/// Descripción breve de Mycon.
/// </summary>
public class MyControl: System.Windows.Forms.UserControl
{
/// <summary>
/// Variable del diseñador requerida.
/// </summary>
private System.ComponentModel.Container components = null;
private myNumber _numbercomposition = new Number(13,0);
public MyControl()
{
// Llamada necesaria para el Diseñador de formularios Windows.Forms.
InitializeComponent();
// TODO: agregar cualquier inicialización después de llamar a
InitializeComponent
}
public myNumber NumberComposition{
get{
return this._numbercomposition;
}
set{
if (this._numbercomposition.ToString() == value.ToString())
return;
this._numbercomposition = value;
if(this.NumberType == NumericType.Integer &&
this._numbercomposition.Scale > 0 )
MessageBox.Show("Value error");
}
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
private void InitializeComponent()
{
components = new System.ComponentModel.Container();
}
#endregion
}
}