Creating custom BorderlessForm
-
I'm trying to create a CustomBorderlessForm and paint myself. I've gotten the basic functionality to work but have this issue. I have derived a TestForm from the custom BorderlessForm and when dropping a menustrip or toolstrip onto the TestForm, these controls dock at the top of the form overlaying the title area which I draw myself. I have tried a number of solutions with no success and now I am just trying to do the simplest thing I can think of. I have created a property on the BorderlessForm to Enable or Disable showing a MenuStrip. When Enabled on the derived TestForm, I create a MenuStrip and place it on the TesForm at a specific location. This works but I cannot edit the MenuStrip from the Designer. Below is code for a custom ParentControlDesigner in which I am trying to EnableDesignMode to allow editing of the MenuStrip. However it still does not work. I have tried debugging into BorderlessFormDesigner below but the Designer does not hit the break point within Initialize(). To do this I have setup the project in MyProject to execute a new instance of VS and load the project. Within the new instance of VS I open the TestForm in the Designer but the Designer does not hit the break point. I've tried setting a break point in both the first and second instance. I've done this sort of thing before with other projects with success. I'm guessing maybe these controls to not support this type of functionality. If this is possible I would appreciate some advice. Thank you. Here is the code excluding the BorderlessForm.Designer.vb code.
Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Runtime.CompilerServices
Imports System.Windows.Forms.Design
Imports System.Windows.Forms.Design.Behavior
_
_
Public Class BorderlessForm
', GetType(ParentControlDesigner))> _Const ConstGridBorderlessTitle As String = "BorderlessForm" ' The MenuStrip object and access for the Designer Private \_MenuStrip As MenuStrip \_ Public ReadOnly Property MenuStrip1() As MenuStrip Get Return Me.\_MenuStrip End Get End Property ' The property to enable showing a MenuStrip