C # .NET programming skills two

xiaoxiao2021-03-06  116

1. BUG: 1 of the NumericUpdownDemo routine: 1 In the NumericUpdown control, you can manually enter the decimal or negative number; Solution: 1 Add NumericUpdown's processing method, the code is as follows:

Switch (E.KeyData)

{

///

/// Simply add the process for '.' And '-'

///

Case keys.subtract:

Case Keys.Oemminus:

MessageBox.show (form.activeform, "/ '- /' is not an available letter!", "Infut error", messageboxbuttons.ok, messageboxicon.error);

NumericUpdown1.resetText ();

Break;

Case Keys.Decimal:

Case keys.oemperiod:

MessageBox.show (Form.Activeform, "/'./ 'is not an available letter!", "Input error", messageboxbuttons.ok, messageboxicon.error);

NumericUpdown1.resetText ();

Break;

DEFAULT:

Break;

}

2 Treatment method is similar, slightly.

2. In the ScrollBardemo routine, when the form is adjusted, Picturebox is still in the original position in the original size, how to make it automatically changed with the size of the form size? Improvement method: 1 Set the Picturebox's Anchor property to Top, Bottom, Left, Right, set the vscrollbar's Anchor property to Bottom, Right, set the HScrollbar's Anchor property to Bottom, Left, Righ; 2 For Form. SizeChanged event Add The following method:

///

/// Eliminate ghost

///

///

///

Private void form1_sizechanged (Object Sender, System.Eventargs E)

{

THIS.REFRESH ();

}

Try how to look:) (Suggested for a big picture)

转载请注明原文地址:https://www.9cbs.com/read-126293.html

New Post(0)