I am writing a button DLL, nothing too fancy just a way of adding extra properties to the button object in an attempt to keep track of extra info and drop several arrays that now hold the info.

The user enables the buttons as required so I could be using 100 to 170 of these buttons in a main VB program.
It also helps me avoid ... Handles Button1.MouseEnter . . . Button170.MouseEnter

All was good until I needed the DLL to set a couple of variables in the main (as yet incomplete) program.

Is there a way of compiling a DLL to change variables in the parent program that contains the DLL ‘Imports BigButton’ line?

Thanks, Kev.

Having a control in a separate assembly reach into your main program directly to change values is not good design.

A better approach is to have your custom button class have an event or callback; your program can register something to happen when the button decides it's time. An event will show up in the forms designer, so you can use it like you would any of the built-in events.

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.