I want to make a control builder program when I add my custom control to the winform - VB.NET, VS2008 - vb.net

I am currently building custom user controls and would like to have a program (that I write) that sets the properties for the control when it is dragged onto the form.
I've seen this working with some controls I've been using - an external program opens (or is available by right clicking on the control).
How is this accomplished?
Edit: An example of an application I use that does this is Farpoint Spread Designer; You can right click on the component and launch the designer application.

Related

Global FormClosing/Load events in .NET

I'm using VB.NET 4.7.2
I have a multi-form application and I'm coding the "Window" menu on top to show open forms so the user can easily switch (now that Win11 has forced combining applications on the taskbar).
I need each open form to be able to handle the FormOpening and Load events generated by other forms. My current solution is to handle those events locally in each form, which then triggers a custom global event that any other form can handle.
But that's a little tedious - is it possible for one form to handle another form's closing or opening without this workaround?
You could subclass a standard form to do all the scut work of registering with the shared global and hooking other forms events. You then just need to change the forms header to point at the subclasses type and off you go.

Make a VBA form appear in windows task bar

I am programming a little application (an overgrown macro really) in Visual Basic for Applications in Office 365. What it does is:
Displays one window that has a few input fields.
Once I fill out those fields with data I can press a button on the form and a summary in a nice graphical form is displayed in a second window (a second form is displayed using UserForm2.show).
The second user form can be updated with new data by typing in updated text in first form and updating the second form by pressing a button on the first form (in the form of UserForm2.TextField1.Text = UserForm1.Label1.Text.
Both forms are modeless so the user can work in Outlook whilst the forms are running.
All works fine except one caveat:
Both forms are not visible on the Windows Taskbar, in the Task Manager, but most importantly they are not visible as separate windows to teleconferencing software we are using. And this is the macro's sole purpose.
Question: Is it possible to make the entire macro (or just UserForm2) run as if it was a separate application, so it appears in the Task Bar as a separate window, and not an internal form running inside Outlook?
The idea is not to run it independently of Outlook (or Excel), but to make them visible to external programs.
I tried a few options available on the Internet, but none of them work, and honestly I do not know where to begin, or how to circumvent it if it is not possible to do directly within the available API. Can you advise?

Display controls in Designer VB.Net 2013

I have a set of controls which are added dynamically to a panel. The number of controls depends on which tab a user selects from TabPage control, which is embedded in a form.
At the moment, the controls don't appear in Designer, but appear during execution.
I managed to display controls for other forms which are not dynamic by moving the non-design code to the vb file, but how can I display the other ones?
The only answer that I know of is to add your code in the .Designer.vb file of the Form.
BUT! I strongly advise you to avoid that if you are not sure how it works! Custom code in the .Designer. files can break your form design and project with possible random crashes.
Also, your code can be changed and removed by the Visual Studio designer:
Custom code in designer.vb file goes away when making edits in design mode
Instead, you can make the panels into custom user controls and add those to the tabs.

Copy / Paste functions not working on first load

I am having an issue with the Ctrl C / Ctrl V options working in a .net Control. This .net control has many textboxes and is called via COM Interop.
Program Flow:
VB6 application creates instance of .net control with the help of Interop Control Toolkit and VBControl Extender. A new tab is created in the code jock tab manager with the .net control as the body. The first time the control is loaded Control C / Control V operations do not work at all. If you close the tab then re-open the same exact control now Control C / Control V work correctly.
If you use the right click context menu to Copy / Paste then it does work.
I have checked Code Jock forumns and didn't find anything useful.
If you add a Key_Up event and capture the Copy that works fine. But we have many .net controls that would need to be changed and doing that for every text box seems like a bad hack. And I know it works without because it works on the second load.
do you open the tab exactly the same way when you open it the second time?
when you add a key_up event it does work on the first load? where did you add the key_up, on the tab or the .net control?
what exactly do you do in the key_up event? could you post the code?
my first guess was that it had something to do with the focus not being on the .net control or tab on first load, but that it has the focus on second load somehow ...

How can I have one menu in all forms in VB.net Win Forms?

May I know if it is possible to have one header menu in all windows forms?
And if so, how can I make it?
Yes its possible to have one header menu in all windows forms using MDI.
MDI is a popular interface because it allows you to have multiple documents (or forms) open in one application. Examples of MDI applications include Microsoft Word, Microsoft Excel, Microsoft PowerPoint®, and even the Visual Studio integrated development environment itself. Each application consists of one (or more) parent windows, each containing an MDI client area—the area where the child forms (or documents) will be displayed. Code you write displays as many instances of each of the child forms that you want displayed, and each child form can only be displayed within the confines of the parent window—this means you can't drag the child forms outside the MDI container.
For more details refer this blog.
Hope this will help you.
Two ways:
Add a User Control to your solution, place a Menu in the User Control and build the application. Then in the ToolBox you have the menu control that you can use on all forms.
Make a WinForm with a Menu then Inherit all your other forms from the base one.
One solution for this is that you can create MDI application.