0

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.

2
Contributors
1
Reply
8
Views
2 Years
Discussion Span
Last Post by gusano79
0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.