Make form always stick to desktop like Win 7 gadget (VB.net) - vb.net

Ok, I'm aware there's a lots of topis about this, but I haven't found anything that works for me.
My program generates a small picture that i would like to keep in a WinForm that's always at the bottom, "with the desktop". Something like the gadgets in windows 7.
How do i tell my form to always stay here, and just can't be visible over any other form/window?
Should'nt this be doable like in the form_load function for this window?
Like this
Private Sub Sticky_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.KeepMeAtTheBottomUntillIAmClosed
End Sub

If you create a form that has no border and no controlbox, the user will not be able to resize or move it. Then add your own button to allow it to close, tell it where you want it to be and tada!
You can even add some mouse over functionality to make the tools appear when you are over the form.

Related

All Handles disappeared vb.net

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.

Nothing works anymore after building project in vb.net

I was going to build my project when i noticed i didn't put an icon,
and since i couldn't access the icon value of the original form because i used a theme i C+X the container and access it from the grey form, change it, C+V the container, built the project.
Nothing changed, all the name of the buttons and stuff are the same, but i feel like nothing is connected to the code anymore, i don't know what happened, i just recently got re-interested into coding, and i have no idea what to do, i tried some things but nothing worked, so here i am, desperate (i spent 3 days on this, i'm REALLY starting from bottom)
link to the project: http://www.mediafire.com/file/2zrbe32lzpx2qhz/SchedulerProjectVBNET.rar
Thanks in advance
It sounds like you have lost all the Handles clauses off your event handlers. As an example, if you add a Button to your form and double-click it, you will get a Click event handler like this:
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Note the Handles clause at the end, which is what connects the code to the event of the control. If you cut that Button from your form to the Clipboard then it no longer exists as part of the form, so that Handles clause will be automatically removed. If you paste the Button back onto the form, the Handles clause is not restored, so the method no longer handles the event.
If that's what has happened - which you can easily check just by looking at the code - then you need to restore all those Handles clauses. You can do that manually, i.e. write them all yourself in the code window, or you can have the designer regenerate them for you. To do the latter, select a control in the designer, open the Properties window, click the Events button, select the desired event and then select the appropriate method from the drop-down list.
Note that you can also double-click an event there to generate a new event handler, which can be useful for handling events other than the default event. You can generate a handler for the default event simply by double-clicking the control.

vb.net buttons won't click after editing them

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

VB.Net: How to display groupbox on right 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.

Windows button appearance in a VB 2008 application

I am creating a Win32-application in Visual Basic 2008. I would like to have a button in the form, with custom color (BackColor), on MouseEnter event. This works fine, but as you can see below, this custom color doesn't cover the whole area of the button. The button border remains as standard (Windows 7). Can I somehow have this color for the whole button? I don't want to use Flat button style, I prefer this Standard style, which has the normal Windows look.
What I typically do is this I first gather two buttons that look similar, such as this Pic A and B.
Then I will put in those two picture into my Resources.
After I begin coding the function such as the Example I have made down below.
Now their are two ways of going about this. There is a hover option as seen below:
Private Sub PictureBox1_MouseHover(sender As Object, e As EventArgs) Handles PictureBox1.MouseHover
PictureBox1.Image = My.Resources.Button1
End Sub
or there is this option which has way better response times when moving your mouse:
Private Sub PictureBox1_MouseEnter(sender As Object, e As EventArgs) Handles PictureBox1.MouseEnter
PictureBox1.Image = My.Resources.Button1
End Sub
Then you need this to set things back to normal:
Private Sub PictureBox1_MouseLeave(sender As Object, e As EventArgs) Handles PictureBox1.MouseLeave
PictureBox1.Image = My.Resources.Button
End Sub
Real simple code but in a realistics thats all you need! I typically hate the buttons! I find myself messing with the button look more then I actually code, really simple to just go to Photoshop and make a easy button that looks good!
I read your Question don't worry but to be honest that style button looks old fashion the buttons I made are more up to date and Modern!