Search results for query: *

  • Users: NKN
  • Order by date
  1. N

    Question How can i paint on the controls when the mouse is clicked on them?

    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...
  2. N

    Question How can i paint on the controls when the mouse is clicked on them?

    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
  3. N

    Question How can i paint on the controls when the mouse is clicked on them?

    It doesn't paint on the control clicked, it paints on the form.
  4. N

    Question How can i paint on the controls when the mouse is clicked on them?

    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}...
  5. N

    Question How to add a .gif image from ressources using GDI+?

    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...
  6. N

    Question How to add a .gif image from ressources using GDI+?

    It worked great, but is there a way where i could insert the "Me.Invalidate" into a sub that handles all the controls at once?
  7. N

    Question How to add a .gif image from ressources using GDI+?

    Thank you Ian Ryder, it worked. Thank you for your help JohnH.
  8. N

    Question How to add a .gif image from ressources using GDI+?

    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...
  9. N

    Retrieving high scores from an Xml file

    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...
  10. N

    How can I select a random control?

    It worked, thank you very much.
  11. N

    How can I select a random control?

    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)...
  12. N

    How can I select a random control?

    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.
  13. N

    How can I select a random control?

    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?
  14. N

    Question Two Forms application is closing

    It worked, thanks.
  15. N

    Question Two Forms application is closing

    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.
  16. N

    Question Adding an event to a picturebox

    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...
  17. N

    Question Adding an event to a picturebox

    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?
  18. N

    Question Adding an event to a picturebox

    I want to add an event when picturebox1 intersects with the picturebox within pb.
  19. N

    Question Adding an event to a picturebox

    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...
Back
Top