Click here to Skip to main content
15,395,360 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: cant get Ascii art to display after the RLE file Pin
ZurdoDev30-Jan-20 2:24
professionalZurdoDev30-Jan-20 2:24 
GeneralRe: cant get Ascii art to display after the RLE file Pin
phil.o30-Jan-20 2:30
mvephil.o30-Jan-20 2:30 
GeneralRe: cant get Ascii art to display after the RLE file Pin
Member 1472117930-Jan-20 2:19
MemberMember 1472117930-Jan-20 2:19 
GeneralRe: cant get Ascii art to display after the RLE file Pin
Dave Kreskowiak30-Jan-20 2:22
mveDave Kreskowiak30-Jan-20 2:22 
GeneralRe: cant get Ascii art to display after the RLE file Pin
phil.o30-Jan-20 2:24
mvephil.o30-Jan-20 2:24 
GeneralRe: cant get Ascii art to display after the RLE file Pin
CHill6030-Jan-20 2:24
mveCHill6030-Jan-20 2:24 
QuestionRe: cant get Ascii art to display after the RLE file Pin
ZurdoDev30-Jan-20 1:24
professionalZurdoDev30-Jan-20 1:24 
QuestionCreating custom BorderlessForm Pin
mo149229-Jan-20 6:57
Membermo149229-Jan-20 6:57 
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.

VB
Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Runtime.CompilerServices
Imports System.Windows.Forms.Design
Imports System.Windows.Forms.Design.Behavior
<ToolboxItem(False)> _
<Designer(GetType(BorderlessForm.BorderlessFormDesigner))> _
Public Class BorderlessForm
    ', GetType(ParentControlDesigner))> _

    Const ConstGridBorderlessTitle As String = "BorderlessForm"

    ' The MenuStrip object and access for the Designer
    Private _MenuStrip As MenuStrip
    <DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _
    Public ReadOnly Property MenuStrip1() As MenuStrip
        Get
            Return Me._MenuStrip
        End Get
    End Property

    ' The property to enable showing a MenuStrip
    <CategoryAttribute(ConstGridBorderlessTitle), _
    EditorBrowsable(EditorBrowsableState.Always), _
    DesignerSerializationVisibility(DesignerSerializationVisibility.Visible), _
    Browsable(True), _
    [ReadOnly](False), _
    BindableAttribute(False), _
    DefaultValueAttribute(GetType(Boolean), "False"), _
    DesignOnly(False), _
    DescriptionAttribute("Show/hide MenuStrip.")> _
    Public Property EnableMenuStrip() As Boolean
        Get
            Return (Me._MenuStrip IsNot Nothing)
        End Get
        Set(ByVal value As Boolean)
            If value = True Then
                If Me._MenuStrip Is Nothing Then
                    Me._MenuStrip = New MenuStrip()
                    Me._MenuStrip.BackColor = Color.LightSteelBlue
                    Me._MenuStrip.Dock = DockStyle.None
                    Me._MenuStrip.Location = New System.Drawing.Point(6, 24)
                    Me._MenuStrip.Name = "BFMenuStrip"
                    Me._MenuStrip.Size = New System.Drawing.Size(336, 24)
                    Me._MenuStrip.TabIndex = 0
                    Me._MenuStrip.Text = "BFMenuStrip"
                    Me.Controls.Add(Me._MenuStrip)
                End If
            ElseIf Me._MenuStrip IsNot Nothing AndAlso Me.Controls.Contains(Me._MenuStrip) = True Then
                Me.Controls.Remove(Me._MenuStrip)
                Me._MenuStrip = Nothing
            End If
        End Set
    End Property


    Public Class BorderlessFormDesigner
        Inherits System.Windows.Forms.Design.ParentControlDesigner

        ' Host object
        Private HostControl As BorderlessForm = Nothing
        ' Used to refresh action list when it changes.
        Private ActionUiService As DesignerActionUIService = Nothing

        ''' <summary>
        ''' Initialization
        ''' </summary>
        ''' <param name="component"></param>
        ''' <remarks></remarks>
        Public Overrides Sub Initialize(ByVal component As System.ComponentModel.IComponent)
            MyBase.Initialize(component)

            If Me.Control Is BorderlessForm Then

                HostControl = DirectCast(component, BorderlessForm)

                ' Give designer access to MenuStrip
                EnableDesignMode(HostControl.MenuStrip1, "BFMenuStrip")
            End If

            ' Acquire a reference to DesignerActionUIService.
            'Me.ActionUiService = GetService(GetType(DesignerActionUIService))

        End Sub
    End Class

End Class


modified 30-Jan-20 13:16pm.

QuestionInteractive QR Code in MS Word 2013 template Pin
Redha Ali29-Jan-20 6:03
MemberRedha Ali29-Jan-20 6:03 
AnswerRe: Interactive QR Code in MS Word 2013 template Pin
Eddy Vluggen29-Jan-20 13:32
professionalEddy Vluggen29-Jan-20 13:32 
AnswerRe: Interactive QR Code in MS Word 2013 template Pin
Dave Kreskowiak29-Jan-20 16:25
mveDave Kreskowiak29-Jan-20 16:25 
QuestionSplit string in a textbox Pin
aginell12324-Jan-20 22:32
Memberaginell12324-Jan-20 22:32 
AnswerRe: Split string in a textbox Pin
phil.o24-Jan-20 23:05
mvephil.o24-Jan-20 23:05 
QuestionAttempting to Connect to an SFTP Server with an Excel Macro Using VBasic Pin
CKinTX24-Jan-20 3:57
MemberCKinTX24-Jan-20 3:57 
AnswerRe: Attempting to Connect to an SFTP Server with an Excel Macro Using VBasic Pin
Richard MacCutchan24-Jan-20 4:09
mveRichard MacCutchan24-Jan-20 4:09 
GeneralRe: Attempting to Connect to an SFTP Server with an Excel Macro Using VBasic Pin
CKinTX24-Jan-20 5:47
MemberCKinTX24-Jan-20 5:47 
GeneralRe: Attempting to Connect to an SFTP Server with an Excel Macro Using VBasic Pin
Richard MacCutchan24-Jan-20 6:01
mveRichard MacCutchan24-Jan-20 6:01 
GeneralRe: Attempting to Connect to an SFTP Server with an Excel Macro Using VBasic Pin
CKinTX24-Jan-20 7:26
MemberCKinTX24-Jan-20 7:26 
GeneralRe: Attempting to Connect to an SFTP Server with an Excel Macro Using VBasic Pin
Richard MacCutchan24-Jan-20 9:05
mveRichard MacCutchan24-Jan-20 9:05 
GeneralRe: Attempting to Connect to an SFTP Server with an Excel Macro Using VBasic Pin
CKinTX24-Jan-20 10:00
MemberCKinTX24-Jan-20 10:00 
GeneralRe: Attempting to Connect to an SFTP Server with an Excel Macro Using VBasic Pin
Richard MacCutchan24-Jan-20 10:21
mveRichard MacCutchan24-Jan-20 10:21 
GeneralRe: Attempting to Connect to an SFTP Server with an Excel Macro Using VBasic Pin
CKinTX24-Jan-20 10:39
MemberCKinTX24-Jan-20 10:39 
GeneralRe: Attempting to Connect to an SFTP Server with an Excel Macro Using VBasic Pin
Richard MacCutchan24-Jan-20 11:26
mveRichard MacCutchan24-Jan-20 11:26 
GeneralRe: Attempting to Connect to an SFTP Server with an Excel Macro Using VBasic Pin
CKinTX28-Jan-20 4:49
MemberCKinTX28-Jan-20 4:49 
AnswerRe: Attempting to Connect to an SFTP Server with an Excel Macro Using VBasic Pin
phil.o24-Jan-20 4:10
mvephil.o24-Jan-20 4:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.