What i'm trying to do is when i click on the form the image is painted at this location (X- that image's width, Y- that image's height) and when i click on a control this image is painted on that control. The problem is when i click on the border of a control the image is only painted on the...
My question is how can i do a paint event for AllCtrls?
Private Sub AllCtrls()
Dim ExceptedCtrl = {StartLabel}
For Each Ctrl As Control In Me.Controls.OfType(Of Control).Except(ExceptedCtrl)
AddHandler Ctrl.Click, AddressOf Ctrl_Click
Next
End Sub
How can i paint on the controls when the mouse is clicked on them? I tried creating a handler for Ctrl.paint but it didn't work. I want the image to be drawn over the control instead of under, like bringing it to the front..
Private Sub AllCtrls()
Dim ExceptedCtrl = {StartLabel}...
I added this code:
Private Sub AllCtrls()
For Each Ctrl As Control In Me.Controls
AddHandler Ctrl.Click, AddressOf Ctrl_Click
Next
End Sub
Private Sub Ctrl_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
DoPaint = True...
I want to load a .gif image with no background at the pointer's location on the form every time the user clicks on the form.
I tried using a picturebox but when two of this same image overlap the background of the picturebox covers the image behind..
How can i do this using GDI+ ?
Dim PB As...
This is the Xml file where the high scores are saved:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Root>
<User Name="Player1">
<HighScore>626</HighScore>
</User>
<User Name="Player2">
<HighScore>352</HighScore>
</User>
</Root>
And this is the code to retrieve the...
This is the code i have:
Public Class Form1
Dim rng As New Random
Dim allPictureBoxes = Controls.OfType(Of PictureBox)()
Dim enemyPictureBoxes = allPictureBoxes.Where(Function(pb) pb.Name.Contains("Enemy"))
Dim ramdomisedPictureBoxes = enemyPictureBoxes.OrderBy(Function(pb)...
I got this error:
An error occurred creating the form. See Exception.InnerException for details. The error is: Public member 'Where' on type '<OfTypeIterator>d__aa(Of PictureBox)' not found.
I have a number of pictureboxes in my form, Some of them are named "Picturebox_Enemy1"; "Picturebox_Enemy2"... "Picturebox_EnemyN".
I want to select a random picturebox containing in its name "Enemy". how can i do that?
I have two forms and a button on the first form. What i want is when i click the button the second form to show and the first one to close.
But this isn't working with:
Form2.show()
Me.close
All the application is closing with the code above.
I've done the part for moving the picturebox with WASD.
But what i want is when the picturebox1 intersects with one of the 40 picturesboxes ("pb" in the code) that this same picturebox dissapear/dispose (and not all the pictureboxes "pb").
how can i do that?
For Each pb As PictureBox In...
I have a picturebox1 that i can move with WASD and another 40 pictureboxes(pb).
what i want is when the picturebox1 intersects with one of the 40 picturesboxes that this same picturebox dissapear (dispose).
how can i do that?
For Each pb As PictureBox In Me.Controls.OfType(Of PictureBox)().Except(New PictureBox() {PictureBox1, PictureBox2}) If PictureBox1.Bounds.IntersectsWith(pb.Bounds) Then MsgBox("ok") End If
How can i add an event to the picturebox that intersects with...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.