Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Please Help Me soon

Please Help Me soon

Scheduled Pinned Locked Moved Visual Basic
help
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mohan_balal
    wrote on last edited by
    #1

    :)This is my code ------------------------------------ Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 39 Then Image1.Left = Image1.Left + 50 End If If KeyCode = 37 Then Image1.Left = Image1.Left - 50 End If If KeyCode = 40 Then Image1.Top = Image1.Top + 50 End If If KeyCode = 38 Then Image1.Top = Image1.Top - 50 End If End Sub Private Sub Timer1_Timer() If Image1.Top = Shape1.Top And Image1.Left = Shape1.Left Then MsgBox "Touch" End If End Sub -------------------- My Problem is: I want to fire the events If the Image1 touch any edge of the shape1.

    D 1 Reply Last reply
    0
    • M mohan_balal

      :)This is my code ------------------------------------ Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = 39 Then Image1.Left = Image1.Left + 50 End If If KeyCode = 37 Then Image1.Left = Image1.Left - 50 End If If KeyCode = 40 Then Image1.Top = Image1.Top + 50 End If If KeyCode = 38 Then Image1.Top = Image1.Top - 50 End If End Sub Private Sub Timer1_Timer() If Image1.Top = Shape1.Top And Image1.Left = Shape1.Left Then MsgBox "Touch" End If End Sub -------------------- My Problem is: I want to fire the events If the Image1 touch any edge of the shape1.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Raise what event? Are you asking how you can define your own custom event and fire it? You have to declare an event to fire first, something like this at the module level, class level, or form:

      Public Event MyEvent(MyArg1 As Integer)
      

      And you fire it like this:

      RaiseEvent MyEvent(someValue)
      

      RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups