用C#实现坐标上的画点
privatevoidTextBox1_KeyDown(objectsender,KeyEventArgse){if(e.KeyCode==Keys.Enter){int...
private void TextBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
int x,y = int.Parse(textBox1.Text);
Point point =newPoint(x,y);
Graphics g = Panel.CreateGraphics();
g.FillEllipse(Brushes.Red,newRectangle());
}
} 如上代码 按回车后显示点 怎么修改它 求大神 焦急等待着 展开
{
if (e.KeyCode == Keys.Enter)
{
int x,y = int.Parse(textBox1.Text);
Point point =newPoint(x,y);
Graphics g = Panel.CreateGraphics();
g.FillEllipse(Brushes.Red,newRectangle());
}
} 如上代码 按回车后显示点 怎么修改它 求大神 焦急等待着 展开
展开全部
//在textbox输入10,10并回车注意中间是英文逗号
private void textBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter)
{
string[] ss = textBox1.Text.Trim().Split(new char[] { ',' });
int x = Convert.ToInt32(ss[0]);
int y = Convert.ToInt32(ss[1]);
Graphics g = textBox1.CreateGraphics();
g.FillEllipse(Brushes.Red, new Rectangle(0, 0, x, y));
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询