Menu strip of parented process not working - vb.net

I have created a application in vb.net 2017. I am parenting another application made in vb.net 2017 to my main application's tab control.
When I am parenting notepad I can access its menu. But when I am parenting self made vb.net another application, Menu is showing but drop down is not showing.

Try to set the AllowDrop property of ContextMenuStrip to True

Related

Tab stops in windows form in Office VSTO addin don't work

I'm writing a simple VSTO add-in for Office. When the user clicks a button a single form appears, and on the form there are some single-line textboxes, some buttons and some labels. This is all in VB.NET.
Everything works as expected - except I cannot tab between controls on the form. I have set the TabIndex and TabStop properties (actually, left them at defaults, which look OK). I've also tried programmatically setting TabIndex and TabStop in the form's Shown handler - but this made no difference. Changing runtime from .NET 4.5 to 4.6 makes no difference.
The odd thing is that if I use exactly the same form (copy & paste the .vb file) in a Windows Forms App, the tab stops work. It seems there's something about this VSTO project (or perhaps all VSTO projects) that is stopping tabbing working.
I am using Visual Studio 2017 and the host application for the VSTO addin is MS Project 2016.
The difference between a standalone WinForms application and your Office add-in is the host application (can be MDI or SDI application).
Most probably you need to specify the parent window handle to the Show method. The method accepts an instance of the IWin32Window interface which represents the top-level window that will own this form.

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.

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

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.

How do I set the default form in vb.Net?

How do I set form number four as the default form that will run when I press on f5 in visual studio 2008. Because form 1 will always be the first to start
Right-click on your project in solution explorer.
Choose properties.
Select the Application Tab.
Select your form from the dropdown under 'startup form'
In the Project Properties, there's a field called "Startup form" - select your form in there.
Right-click your Project within the Solution Explorer.
Choose Properties.
Select the Web tab on the left-hand side.
Under the Start Page section, define the Specific Page you would
like to default to when the application is launched.
Save your changes.
Right-click your Project within the Solution Explorer.
Choose Properties.
Select the Web tab on the left-hand side.
Under the Start Page section, define the Specific Page you would like to default to when the application is launched.
Save your changes.
The other solutions work, but they will disable the use of ApplicationEvents like Startup, because the startup object has to be Sub Main for those to work.
To change the form started by Sub Main, do the following:
Close your project in Visual Studio.
Open your project's folder in explorer.
In it, open folder My Project.
Open Application.myapp with any text editor.
Change the form between the <MainForm> tags to your (new) main forms name.
Save and close.
Open ApplicationDesigner.vb with any text editor.
Find the following line and change YourMainFormsName to your (new) main forms name:
Protected Overrides Sub OnCreateMainForm()
Me.MainForm = Global.YourProjectsName.YourMainFormsName
End Sub
Save and close.
Open your project again and start it up. The startup form should have changed.
In my case, it doesn't work immediately from project properties. I have to close the solution and re-open it in order to see the latest form you have created and if you intend to make a startup object.

VB .NET Save Panel without form

In Visual Studio 2008, using VB .NET, I have a Split Container that I want to dynamically load panels into the Panel2 slot from other team member's work based on user input in the Panel1 controls.
Can my team members work on panels outside of a form, save it, then have the main Form just load those panels when needed without copying and pasting each panel into the form and making them visible and invisible?
Thanks.
Sure, have the team build user controls which you will then add to the control collection for the panel.