Goran Bibic

Goran Bibic

  • 455
  • 2.9k
  • 198k

Text box and combo box value from Form 2 to From 1

Mar 27 2018 2:54 AM
I have some problem
On form 1 make the code
On form2 make public all textboxex
  1. private void button19_Click(object sender, EventArgs e)
  2. {
  3.    artikl_search lupa = new artikl_search();
  4.    lupa.Show();
  5.    idTextBox1.Text = lupa.idTextBox.Text;
  6.    nazivComboBox.Text = lupa.naziv_artiklaTextBox.Text;
  7.    textBox2.Text = lupa.grupa_artikalaTextBox.Text;
  8.    jedinica_mjereTextBox.Text = lupa.jedinica_mjereTextBox.Text;
  9.    kolicinaTextBox.Text = lupa.kolicinaTextBox.Text;
  10.    cijena_bez_pdvTextBox.Text = lupa.cijena_bez_pdvTextBox.Text;       
  11. }
On form 2
 
Make textbox and other boxes to be public...but...problem is when I chose values on Form2, 
on Form1 give me always value first row in datagreed...not selected value from Form2
 
Maybe is problem  line 8?
nazivComboBox.Text = lupa.naziv_artiklaTextBox.Text;
Form1 is combo box, on Form 2 is textbox

Answers (2)