Sure I am being a bit thick but can anyone tell me how I can add a save button to the Krypton Ribbon file tab. For all other tabs I can drag from the toolbox but I cant for the life of me figure out how to add a button or anything else to the file tab. I'm using vb.net and cant find anything on google explaining how to do this at all
Many Thanks
Gibbo
Figured it out, was being daft, in the properties of the ribbon you can add a button in the RibbonAppButton to AppButton MenuItems/ AppButtonSpecs.
Then just add an onclick event in the code
Private Sub BtnSave_Click(sender As Object, e As EventArgs) Handles BtnSave.Click
Thanks for looking
Related
I was working on a project and for no reason all Handles disappeared from the form
For example:
Private Sub Button17_Click(sender As Object, e As EventArgs) Handles Button17.Click
has become
Private Sub Button17_Click(sender As Object, e As EventArgs)
I have a lot of tools in the form
Is there a shortcut to retrieve Handles?
This happens if a control is being cut and pasted back on the form or if it's deleted and recreated with the same name.
To recreate the Handles you can click behind the closing bracket and press SPACE - TAB - SPACE and fill the rest up with the help of IntelliSense.
There's nothing to retrieve. They are just regular methods now. You need to attach them to the appropriate events like you would any other method you wrote yourself. Open the Properties window in the designer and click the Events button. Select a control on the form, click the drop-down for the event of interest and select the correct method.
I am developing a POS in vb.net and want to use Enter key as tab. this works well in controls other than button. e.g when the focus is on textbox or combobox etc then it works good but if the focused control is button then it does not move to next control. Help me by fixing this problem, I have searched alot but could not find any solution regarding this.
thanks
Regards
Muhammad Irfan Sumra
Enter key for button have default behavior which raise Click event.
You can handle Click event for moving focus to next control, and use MouseClick event for your click logic
Private Sub MyButton_Click() Handles MyButton.Click
SendKeys.Send("{TAB}")
End Sub
Private Sub MyButton_MouseClick() Handles MyButton.MouseClick
' Do your click logic
End Sub
I made a nice program while learning and everything was going good until I did something, but I forgot what I did. Now the buttons won't click but they all have the functions.
I know it's something in the properties but I forgot what it was.
vb.net express 2013
Without code provided, we can't really help that much. But what you can do is create another button, then copy whatever the code of your old button was, and paste it to your new button created.
In Visual Studio when you cut and paste any Control instead of simply drag it in a new position it will lost every event handler already added.
In your case simply add Handles clause to your YourButtonName_Click sub:
Private Sub YourButtonName_Click(sender As System.Object, e As System.EventArgs) Handles YourButtonName.Click
I am making a VB.Net web browser, and to make the whole thing look nice, when the user right clicks, I want a groupbox to show up where the mouse was right clicked. I am using the ChromeWebBrowser.Net project on SourceForge and when I add the following code:
Private Sub ChromeWebBrowser1_MouseUp(sender As Object, e As MouseEventArgs) Handles ChromeWebBrowser1.MouseUp
If e.Button = Windows.Forms.MouseButtons.Right Then
GroupBox1.Location = (e.Location)
GroupBox1.Visible = True
Else
End If
End Sub
It should be working, but when I test it and right click on the web browser control, it does not show up. When I add the same code to the main forms code, it works fine, it just is not working on the browsing control. No errors or anything, it will just not show up. Is there something special I need to do, or can there be a workaround to this?
Thanks so much!
Honestly, this sounds more like you should be using a ContextMenuStrip. You can drop one onto your form(then add items to it), and finally after that you can set the webbrowser's contextmenustrip property to be the one you just designed.
In my project, I'm adding a ListBox whose items are retrieved from a database. What I want to do is to add a button to the right of each item on the ListBox that, when pressed, deletes that item from the database and refreshes the ListBox.
Now, getting the button to do that will be easy (quite possibly a Click() event on the button), but my problem is that I can't find a way to actually add a button to the ListBox.
Does anyone know how to do this?
BTW this is in a VB desktop app project.
A DataGridView would be an easier solution, it already includes all the functionality you require. Simply add a text column and a button column, then you can subscribe to the Cell ContentClick event For example:
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
'your database code here
DataGridView1.Rows.RemoveAt(e.RowIndex)
End Sub
There's an article on the msdn about putting controls into DataGridViews. Check this out and see if it gets you any closer to what you want.
http://msdn.microsoft.com/en-us/library/7tas5c80.aspx