Jan 26th, 2005, 03:55 PM
#1
About Button in Design Time Properties Window [RESOLVED!!! Thanks Pax :thumb:]
In VB6 when we made a usercontrol we could add an about button for the
design time properties window. Can we do anything similar in .NET?
Thanks.
Last edited by RobDog888; Feb 4th, 2005 at 12:01 PM .
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Jan 26th, 2005, 06:36 PM
#2
Sleep mode
Umm , I think you mean the description item in the properites explorer . Just look up the ....doh I forgot that class . I'll come back with the name.
Jan 26th, 2005, 06:47 PM
#3
Re: About Button in Design Time Properties Window
Oh, I didnt see your response til now. This is what I have. Aaron Young helped
me with it last night, but what I was wondering in this thread was if there
was an about button for controls that you can click on and bring up a small
form about the controls creator, etc.
I also saw that you can place hyperlinks to do action in the descriptions too.
How do you do that?
VB Code:
<Browsable(True), DefaultValue("AutoScroll"), Description("AutoScroll for XPNavBar.")> _
Public Overrides Property AutoScroll() As Boolean 'Shadows ReadOnly
Get
Return mb_AutoScroll
End Get
Set(ByVal Value As Boolean)
mb_AutoScroll = Value
End Set
End Property
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Jan 27th, 2005, 12:39 AM
#4
Sleep mode
Yah , Attributes . This is what I was going to say in my previous post .Kinda funny to forget that huge class .
I don't know a lot about Attributes and their properties but it's well-documented in MSDN .
Jan 27th, 2005, 01:03 AM
#5
Re: About Button in Design Time Properties Window
This is also a good alternative that I could use, but I cant find out how to do
it or what its called.
Also, how do you get the button with the elipsis (...)? I searched MSDN, but
nothing yet.
Attached Images
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Jan 27th, 2005, 01:05 AM
#6
Re: About Button in Design Time Properties Window
Originally Posted by
RobDog888
This is also a good alternative that I could use, but I cant find out how to do
it or what its called.
Also, how do you get the button with the elipsis (...)? I searched MSDN, but
nothing yet.
I believe the property grid will automatically do that for you if the property is collection based.
Jan 27th, 2005, 01:11 AM
#7
Re: About Button in Design Time Properties Window
Thanks, but how do I create a property collection and do you know if the
hyperlink (Add Tab) is automatic also?
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Jan 27th, 2005, 01:28 AM
#8
Re: About Button in Design Time Properties Window
Jan 27th, 2005, 01:32 AM
#9
Re: About Button in Design Time Properties Window
I looked through them quickly and I can see that it is part of what I need.
Do you have something for the hyperlink in the description of the property?
I will go over them in detail tomorrow. Tired. Going to sleep.
Thanks.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Jan 27th, 2005, 04:00 AM
#10
Re: About Button in Design Time Properties Window
Originally Posted by
RobDog888
I looked through them quickly and I can see that it is part of what I need.
Do you have something for the hyperlink in the description of the property?
I will go over them in detail tomorrow. Tired. Going to sleep.
Thanks.
No I don't. I know that'll come up if you inherit from TabPages though. If I'm not mistaken, crptcblade had a similar problem a while ago. The memories are vague though, kinda like the first age on Middle Earth...
Jan 27th, 2005, 07:30 AM
#11
Re: About Button in Design Time Properties Window
Hi.
You need to make a new class that inherits ControlDesigner.
Then override the Verbs property.
Return a new collection of verbs. Each verb in the collection refers to a sub in the designer. Each verb will be shown as a link in the propertywindow.
Then you need to add a DesignerAttribute to your class.
Remember to add a reference to System.Design.Dll
VB Code:
<System.ComponentModel.Designer(GetType(MyControl.MyDesigner))> _
Public Class MyControl
Inherits System.Windows.Forms.UserControl
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'UserControl overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Label1 As System.Windows.Forms.Label
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label()
Me.SuspendLayout()
'
'Label1
'
Me.Label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.Label1.Dock = System.Windows.Forms.DockStyle.Fill
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(150, 150)
Me.Label1.TabIndex = 0
Me.Label1.Text = "This is a testcontrol"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'MyControl
'
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.Label1})
Me.Name = "MyControl"
Me.ResumeLayout(False)
End Sub
#End Region
Public Class MyDesigner
Inherits System.Windows.Forms.Design.ControlDesigner
Private MyVerbs As System.ComponentModel.Design.DesignerVerbCollection
Private Sub MyAboutVerb(ByVal sender As Object, ByVal e As EventArgs)
MsgBox("You clicked the 'About' link")
End Sub
Private Sub MyAnotherVerb(ByVal sender As Object, ByVal e As EventArgs)
MsgBox("You clicked the 'AnotherVerb' link")
End Sub
Private Sub MyYetAnotherVerb(ByVal sender As Object, ByVal e As EventArgs)
MsgBox("You clicked the 'YetAnotherVerb' link")
End Sub
Public Overrides ReadOnly Property Verbs() As System.ComponentModel.Design.DesignerVerbCollection
Get
If MyVerbs Is Nothing Then
MyVerbs = New System.ComponentModel.Design.DesignerVerbCollection()
MyVerbs.Add(New System.ComponentModel.Design.DesignerVerb("About", AddressOf MyAboutVerb))
MyVerbs.Add(New System.ComponentModel.Design.DesignerVerb("AnotherVerb", AddressOf MyAnotherVerb))
MyVerbs.Add(New System.ComponentModel.Design.DesignerVerb("YetAnotherVerb", AddressOf MyYetAnotherVerb))
End If
Return MyVerbs
End Get
End Property
End Class
End Class
Hope this helps.
EDIT: You could also take a look at www.divil.co.uk .
He has a great article about creating designers.
I wish I could think of something witty to put in my sig...
...Currently using VS2013...
Jan 27th, 2005, 10:24 PM
#12
Re: About Button in Design Time Properties Window
Thans for the code and links guys. They are going to be very helpful. I will
try out my code tonight and if I have anymore problems I will post them.
Thanks again.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 1st, 2005, 03:32 PM
#13
Re: About Button in Design Time Properties Window
Pax, I am having a little trouble getting it to work. What am I doing wrong?
I did add the reference to System.Design.Dll too.
VB Code:
Imports System.ComponentModel
<ToolboxBitmap(GetType(MyControl), "MyControl.bmp")> _
Public Class MyControl
Inherits System.Windows.Forms.UserControl
[color=silver]"Windows Form Designer generated code"[/color]
Private Sub MyControl_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
'...
'...
'...
End Sub
'CODE FOR CREATING THE HYPERLINKS TO THE DESCRIPTION WINDOW IN THE DESIGN PROPERTIES.
Public Class MyDesigner
Inherits System.Windows.Forms.Design.ControlDesigner
Private MyVerbs As System.ComponentModel.Design.DesignerVerbCollection
Private Sub MyAboutVerb(ByVal sender As Object, ByVal e As EventArgs)
MessageBox.Show("About MyControl, Blah, Blah, Blah.", "MyControl", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Public Overrides ReadOnly Property Verbs() As System.ComponentModel.Design.DesignerVerbCollection
Get
If MyVerbs Is Nothing Then
MyVerbs = New System.ComponentModel.Design.DesignerVerbCollection
MyVerbs.Add(New System.ComponentModel.Design.DesignerVerb("About", AddressOf MyAboutVerb))
End If
Return MyVerbs
End Get
End Property
End Class
End Class
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 2nd, 2005, 03:49 AM
#14
Re: About Button in Design Time Properties Window - Not resolved
Hi.
I think you're missing the Designer attribute.
VB Code:
<[B]Designer(GetType(MyDesigner))[/B], ToolboxBitmap(GetType(MyControl), "MyControl.bmp")> _
Public Class MyControl
Inherits System.Windows.Forms.UserControl
"Windows Form Designer generated code"
Private Sub MyControl_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
'...
'...
I wish I could think of something witty to put in my sig...
...Currently using VS2013...
Feb 2nd, 2005, 11:20 PM
#15
Re: About Button in Design Time Properties Window - Not resolved
Yes, but I didnt know how to implement it and keep my control bitmap.
Thanks, I wil give it another try.
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 3rd, 2005, 12:38 AM
#16
Re: About Button in Design Time Properties Window - Not resolved
MyDesigner is coming up as "not defined".
VB Code:
Imports System.ComponentModel
<Designer(GetType([color=red]MyDesigner[/color])), ToolboxBitmap(GetType(MyControl), "MyControl.bmp")> _
Public Class MyControl
Inherits System.Windows.Forms.UserControl
"Windows Form Designer generated code"
Private Sub MyControl_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
'...
'...
'...
End Sub
'CODE FOR CREATING THE HYPERLINKS TO THE DESCRIPTION WINDOW IN THE DESIGN PROPERTIES.
Public Class MyDesigner 'BUT ITS DEFINED HERE?
Inherits System.Windows.Forms.Design.ControlDesigner
Private MyVerbs As System.ComponentModel.Design.DesignerVerbCollection
Private Sub MyAboutVerb(ByVal sender As Object, ByVal e As EventArgs)
MessageBox.Show("About MyControl, Blah, Blah, Blah.", "MyControl", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Public Overrides ReadOnly Property Verbs() As System.ComponentModel.Design.DesignerVerbCollection
Get
If MyVerbs Is Nothing Then
MyVerbs = New System.ComponentModel.Design.DesignerVerbCollection
MyVerbs.Add(New System.ComponentModel.Design.DesignerVerb("About", AddressOf MyAboutVerb))
End If
Return MyVerbs
End Get
End Property
End Class
End Class
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 3rd, 2005, 02:39 AM
#17
Re: About Button in Design Time Properties Window - Not resolved
Sorry. My fault.
The designer is INSIDE the control class so the attribute should look like:
VB Code:
<Designer(GetType([B]MyControl.[/B]MyDesigner)), ToolboxBitmap(GetType(MyControl), "MyControl.bmp")> _
Public Class MyControl
.
.
.
I wish I could think of something witty to put in my sig...
...Currently using VS2013...
Feb 3rd, 2005, 04:59 PM
#18
Re: About Button in Design Time Properties Window - Not resolved
Yea! Error went away! I dont have time right now to do the testing on the
build but I hope it will work. Be back in a few hours.
Thanks Pax
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 4th, 2005, 12:00 PM
#19
Re: About Button in Design Time Properties Window - Not resolved
YES, YES, YES, IT WORKS! This is so cool. I cant thank you guys enough
for your patience and help on this.
Now its on to the "next" problem
Last edited by RobDog888; Feb 4th, 2005 at 01:08 PM .
VB/Office Guru™ (AKA: Gangsta Yoda ™ ® )
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Feb 4th, 2005, 01:08 PM
#20
Re: About Button in Design Time Properties Window [RESOLVED!!! Thanks Pax :thumb:]
Cool. Glad I could help.
I wish I could think of something witty to put in my sig...
...Currently using VS2013...
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width