inputbox with c#

  • Thread starter Thread starter Stefan Derle
  • Start date Start date
S

Stefan Derle

there is no support of a inputbox with c#. Tryed to
create a shrinked form with a textbox and called it with
showDialog(). But the form covered the whole screen.
Played with the properties of the form but I found no
combination that worked. The same code worked at the
workstation fine. What's to do?
 
There have been a number of messages previously about the ability to have
smaller-than-full-screen-sized forms. Here's the text for one reply to this
same question:

-----

What you have to do is the following: Set the MinimizeBox, the MaximizeBox
and the ControlBox properties
of your form false and change the FormBorderStyle to none.
--
Regards,
Maarten Struys
PTS Software bv

-----

You can search the archived posts at:

http://groups.google.com/groups?hl=...soft.public.dotnet.framework.compactframework

Paul T.
 
and you should also add this peace of code, would improve the user
experience !
where BlueBrush is a cached brush with SystemColors.ActiveCaption color
//----------------------------------
protected override void OnPaint(PaintEventArgs e)

{

base.OnPaint (e);

e.Graphics.FillRectangle(AppDefaults.BlueBrush, 0, 0, Width, 24);

e.Graphics.DrawRectangle(AppDefaults.TextPen, 0, 0, Width-1, Height-1);

e.Graphics.DrawString(Text, AppDefaults.BoldFont, AppDefaults.WhiteBrush, 2,
4);

}

protected Point MouseDownPoint;

protected override void OnMouseDown(MouseEventArgs e)

{

base.OnMouseDown (e);

Capture = true;

MouseDownPoint = new Point(e.X, e.Y);

}

protected override void OnMouseMove(MouseEventArgs e)

{

base.OnMouseMove (e);

if(Capture)

{

int dx = e.X - MouseDownPoint.X;

int dy = e.Y - MouseDownPoint.Y;

Point p = Location;

p.X += dx;

p.Y += dy;

Location = p;

}

}

protected override void OnMouseUp(MouseEventArgs e)

{

base.OnMouseUp (e);

Capture = false;

}

//----------------------------------
 
Back
Top