Here's how to make a small custom dialog in Windows Mobile that looks like this:
alt text http://www.freeimagehosting.net/uploads/b8fb5421d6.jpg
FormBorderStyle None. , , , .
, . - BackColor SystemColors.WindowFrame, (, "" ) BackColor = SystemColors.Highlight ForeColor = SystemColor.HighlightText( ), BackColor = SystemColors.Window, . , 1- ( ).
, , (, , ):
private bool _Moving = false;
private Point _Offset;
private void Form1_MouseDown(object sender, MouseEventArgs e)
{
_Moving = true;
_Offset = new Point(e.X, e.Y);
}
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
if (_Moving)
{
Point newlocation = this.Location;
newlocation.X += e.X - _Offset.X;
newlocation.Y += e.Y - _Offset.Y;
this.Location = newlocation;
}
}
private void Form1_MouseUp(object sender, MouseEventArgs e)
{
if (_Moving)
{
_Moving = false;
}
}
, , , . OK ( ) Click event:
this.DialogResult = DialogResult.OK;
, , . , , .
.
: , OK. ControlBox False, "" "X" "" , , .