سلام سلام داداشای گلم
من میخوام گروپ باکسمو مثلا با کد نمایش بدم و اگه کد اشتبا بود بگه اشتباس
من میخوام گروپ باکسمو مثلا با کد نمایش بدم و اگه کد اشتبا بود بگه اشتباس
No user |
private void Form1_Load(object sender, EventArgs e)
{
groupBox1.Visible = false;//form k load mishe groupbox1 ro neshon nade
}
if (textBox1.Text == "mohammad")//inja migim agar texbox1 = mohammad bod
groupBox1.Visible = true;//groupbox1 ro neshon bede
else//dar qeyre in sorat
{
groupBox1.Visible = false;//grouobox1 ro neshon nade
MessageBox.Show("eror is code", "PM", MessageBoxButtons.OK, MessageBoxIcon.Error);//inam k moshakhase
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if (checkBox1.Checked == true)//age chekedbox true bod
groupBox1.Visible = true;//groupbox1 ro neshon bede
else
{
if (checkBox1.Checked == false)//age false bod
groupBox1.Visible = false;//groupbox1 ro neshon nade
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace C_charp_team_Hide
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
groupBox1.Hide();
}
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text == "mohamad")
groupBox1.Show();
else
{
MessageBox.Show(" Eshtebah ");
}
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace C_charp_team_Hide
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
groupBox1.Hide();
button1.Text = "Show";
}
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text == "mohamad" &&button1.Text == "Show")
{
groupBox1.Show();
button1.Text = "Hide";
}
else if (textBox1.Text == "mohamad" && button1.Text == "Hide")
{
groupBox1.Hide();
button1.Text = "Show";
}
else
{
MessageBox.Show("Eshtebah");
}
}
}
}
|
|