Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void btnTip_Click(object sender, EventArgs e)
- {
- using (var form = new frmTipVrste(true))
- {
- var result = form.ShowDialog();
- if (result == DialogResult.OK)
- {
- string tvID = form.tvID;
- Image img = form.tvImg;
- this.txtTip.Text = tvID;
- this.pictureBox1.Image = img;
- if (img == null)
- {
- btnIcon.Enabled = true;
- }
- if (String.IsNullOrEmpty(tvID))
- {
- epHandler.SetError(txtTip, "Error: Odaberite validan tip!");
- validTip = false;
- }
- else
- {
- epHandler.SetError(txtOznaka, "");
- validTip = true;
- }
- }
- }
- }
- // U formi od tipa:
- private bool izbor = false;
- public string tvID {get; set;}
- public Image tvImg {get; set;}
- public frmTipVrste(Boolean izbor)
- {
- InitializeComponent();
- this.izbor = izbor;
- }
- // u selectionChanged od tabele:
- if (this.izbor)
- {
- this.tvID = tv.oznaka + " | " + tv.ime;
- this.tvImg = tv.ikonica;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement