code to open form from toolstrip, same code yet among one code cannot .show();

Rudi Hartono 116 Reputation points
2020-12-12T13:25:26.6+00:00
        private void userToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frUser user = new frUser();
            user.Show();
        }


        private void categoryToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frCategory category = new frCategory();
            category.Show();
                

hi, why i can open user form using this code yet cannot do for category?
when i put 'category.' the suggestion didnt show up 'Show' and when i manually do this, the code is not being recognized by vs.

this is a code at a main form to open subform using tool stripbar.

thank you

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,475 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Viorel 113.7K Reputation points
    2020-12-12T13:40:05.017+00:00

    Probably frCategory is not a form. Maybe it is a User Control or something else.

    What do you see if you select frCategory and press <F12> (which is “Go to definition”)?

    0 comments No comments