Navbar Button - How-To
Learn how to create Add-Ins of all types for V3-R and share your own tutorials with others.
1 post
Page 1 of 1
Hello,
In this tutorial I will quickly show you how to create an Add-In which displays a button in the Navigation Bar of V3-R - next to newtab and favorites.
Ok the first thing you need to do is start a new project and add the AppGlue class file code as normal.
Then we need to add a new Class file to our project and call it 'MyButton'
Now lets add our code to the MyButton class file:
That was easy but now we need to give our button an image otherwise it wont look very good so add an image resource to your project and alter your MyButton code as follows:
Now we have our button made but its not much use to us unless it does something when you click it. So lets alter our code again and add a click event to our button which will display a message box on click:
First locate the "ToolStripButton" setting and uncomment the MyButton code on the end like this:
Compile/Build the code and test it out in V3-R.
So now you know how to add a navbar button to V3-R you can get on and create some great Add-Ins cooll;
In this tutorial I will quickly show you how to create an Add-In which displays a button in the Navigation Bar of V3-R - next to newtab and favorites.
Ok the first thing you need to do is start a new project and add the AppGlue class file code as normal.
Then we need to add a new Class file to our project and call it 'MyButton'
Now lets add our code to the MyButton class file:
Code: Select all
Imports System.Windows.Forms
Public Class Mybutton
Inherits ToolStripButton
End Class
That was easy but now we need to give our button an image otherwise it wont look very good so add an image resource to your project and alter your MyButton code as follows:
Code: Select all
Imports System.Windows.Forms
Public Class Mybutton
Inherits ToolStripButton
Sub New()
Me.Image = My.Resources.NameOfImageResource
End Sub
End Class
Now we have our button made but its not much use to us unless it does something when you click it. So lets alter our code again and add a click event to our button which will display a message box on click:
Code: Select all
You can use the click event to do anything you want like display a form, run code in the background, display a message box etc. Our button is now complete so lets goto our AppGlue class file and make some small changes to our settings.Imports System.Windows.Forms
Public Class Mybutton
Inherits ToolStripButton
Private Sub MyButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click
MsgBox("You clicked me!")
End Sub
Sub New()
Me.Image = My.Resources.NameOfImageResource
End Sub
End Class
First locate the "ToolStripButton" setting and uncomment the MyButton code on the end like this:
Code: Select all
Then we need to tell V3-R that its a button we are adding so change the "iLocation" setting to 5 like this:Private ToolStripButton As ToolStripItem = New Mybutton
Code: Select all
And thats it..we are finished!.Private iLocation As String = 5
Compile/Build the code and test it out in V3-R.
So now you know how to add a navbar button to V3-R you can get on and create some great Add-Ins cooll;
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
1 post
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023