private void button1_Click(object sender, EventArgs e) { PicPaint.Refresh(); positionY = 5; listFunction.Clear(); txtFunction.Text = ""; }
string cai2 = @"C:\\nguon\app\Install.exe"; //duong dan copy den thuc muc khoi dong #region Events private void frmMain_Load(object sender, EventArgs e) { g = PicPaint.CreateGraphics(); // tạo thư mục nguồn create(); // // code kiểm tra kết nối mạng checkConnectInternet(); }
protected override void OnPaint(PaintEventArgs pe) { PicPaint.Refresh(); //foreach (string item in listFunction) //{ // PaintGraph(item,oldPosition); //} foreach (string item in listFunction) { PaintGraph(item, oldPosition); g.DrawString("y=" + item, new Font("Tahoma", 10), new SolidBrush(Color.Blue), 5, oldPosition += 20); } oldPosition = 5; }
private void trkZoom_MouseUp(object sender, MouseEventArgs e) { k = (trkZoom.Value + 1) * 5; AutoMinMax(); PicPaint.Refresh(); foreach (string item in listFunction) { PaintGraph(item, oldPosition); g.DrawString("y=" + item, new Font("Tahoma", 10), new SolidBrush(Color.Blue), 5, oldPosition += 20); } oldPosition = 5; trkZoom.Focus(); }
private void PaintGraph() { fn.Parse(txtFunction.Text.ToLower()); fn.Infix2Postfix(); arr = fn.Variables; if (arr.Count != 1) { MessageBox.Show("Biểu thức không hợp lệ. Vui lòng nhập lại !\n\nVí dụ: (sin(x)+3)/(x+4)", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } else { if (arr[0].ToString() != "x") { MessageBox.Show("Biểu thức không hợp lệ. Vui lòng nhập lại !\n\nVí dụ: (sin(x)+3)/(x+4)", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } } PicPaint.Refresh(); btnPaint.Enabled = false; Application.DoEvents(); int.TryParse(txtMin.Text, out min); int.TryParse(txtMax.Text, out max); ttStatus.Text = "Trạng thái: Đang vẽ ...."; VeTrucToaDo(); Application.DoEvents(); g.DrawString(txtFunction.Text, new Font("Tahoma", 10), new SolidBrush(Color.Red), 5, 5); Pen pen = new Pen(Color.Red, 2); VeDoThi(); btnPaint.Enabled = true; delay = 0; ttStatus.Text = "Trạng thái: Hoàn tất !"; }
private void btnZoomIn_Click(object sender, EventArgs e) { btnZoomIn.Enabled = false; k = k + 10; AutoMinMax(); PicPaint.Refresh(); //foreach (string item in listFunction) //{ // PaintGraph(item, oldPosition); //} foreach (string item in listFunction) { PaintGraph(item, oldPosition); g.DrawString("y=" + item, new Font("Tahoma", 10), new SolidBrush(Color.Blue), 5, oldPosition += 20); } oldPosition = 5; btnZoomIn.Enabled = true; }
private void frmMain_Load(object sender, EventArgs e) { g = PicPaint.CreateGraphics(); }