Home > Mobile >  triggering a button on mainform without using main.Show(); from childform
triggering a button on mainform without using main.Show(); from childform

Time:10-21

First of all, I am not experienced coder.

I have been coding a windows desktop application which uses a lot of forms. Main form has a panel that controls childforms and app makes calculations in thoose childforms than records results in ms-access database. I was wondering if I could reach button located in main form without usind Formmain main = new Formmain(); - main.Show();I would like to trigger that button on mainform automatically. I would love to know if that is possible.

Best regards.

CodePudding user response:

You could achieve something similar using the enter image description here

enter image description here

CodePudding user response:

Allthough I wasn't able to explain my problem very well, I found a solution. Here is solution code for those who are suffering from same problem. Aditionally thanks again @Jiale Xue for patience and effort.

Best regards.

FormKarbonMain karbonMain = (FormKarbonMain)Application.OpenForms["FormKarbonMain"];

karbonMain.txtAyakIzi.Text = toplamemisyon.ToString("N4");

  • Related