i have button on main form which i want to visible when i click on the button which is on the sub form.

I came across a similar problem in a test project.

I might be wrong, but you have to pass the instance of the original button to the subform as a parameter. Once you do that, you can set the main button visible.

It would help if you post some code.

Regards.

In my opinion, you shouldn't do it that way. In order to do it "properly" I suggest in your child/sub form, you create an event which is something like "ButtonOneClicked" or something.

When you click the button, you fire the event. In your parent form, you hook the event and do whatever you need to do when the button is clicked. You can pass data back from the child form to the parent form in your event args.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.