Anything that you can create in the design time can be created in the run time. What I would recommend you do is create a "Test Project" with just the default settings. Then under "Project" choose "Show All Files". This will add additional files in your Solution Explorer. By drilling into Form 1, you'll see a file named "Form1.designer.vb". Open that and you'll see all of the Automatically created code. Once you know where that is, the fun can begin
Go back to your form designer and create your tool strip buttons the way you want it during Run-Time. Then, go to your designer.vb file and find the new entries. It will have the code exactly as you need it. Copy and paste it into your "real" project in the Form Load event (or where ever it needs to be) and you've got what you need.
oh yeah...forgot to add...that's what I did to get the previous lines of code You may need to do some tweaking as far as adding references, declaring variables etc...but the compiler will tell you what it wants.
Any time. Just remember the little trick of keeping a test project available. It's saved me hours of research in the past. You can also learn a lot about how bindings and other behind the scenes referencing works. Great learning tool
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.