2
I’ve got two presses, one of them I’ve got:
namespace J13_Rouparia_CS
{
public partial class frmMain : Form
{
public static int LocPesq;
public static string peqNume;
public static string peqArti;
public void UpdatePesquisa()
{
switch (LocPesq)
{
case 1:
txtSRnum.Text = peqNume;
txtSRartigo.Text = peqArti;
break;
case 2:
txtELnum.Text = peqNume;
txtELartigo.Text = peqArti;
break;
case 3:
txtSLnum.Text = peqNume;
txtSLartigo.Text = peqArti;
break;
}
}
}
}
The next I’d like to run the UpdatePesquisa()
, using frmMain.UpdatePesquisa()
, but the method UpdatePesquisa
does not appear in the list. How can I resolve this situation?
I crossed out the first sentence of your answer because it’s incorrect, actually the method can only be viewed outside the class if it’s public, but I didn’t want to change your answer and let you edit it, okay? I also forgot to change the name of the method of
UpdateProgress()
forUpdatePesquisa()
, I made a second edition, but I don’t know if it’ll be accepted, so anything you can change, please. Now, about this first suggestion you gave with the active form, I think it is difficult that the second form is open before offrmMain
, which, by name, is the main!– Pedro Gaspar
Peter, Thanks for the help! Really got confused the answer. About the name of the form, I also think it is already active, but I thought better to inform the solution if it is not.
– Nícolas Tarzia
This excerpt from your reply: "You will not be able to visualize the method because it is public" is wrong. The method of being public is not the reason why it cannot be visualized, on the contrary, if it were not public, then it would not be visualized. So I had scratched that part out, I hoped you’d delete it! And there’s another
UpdateProgress()
wrong in the first paragraph.– Pedro Gaspar