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
  1. Home
  2. General Programming
  3. C#
  4. Can I call Paint event from reguler events to make changes through GDI.

Can I call Paint event from reguler events to make changes through GDI.

Scheduled Pinned Locked Moved C#
graphicshelptutorial
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.
  • N Offline
    N Offline
    Naveed727
    wrote on last edited by
    #1

    I am going to create a custom control and want to add an ability. When it get focused then It appearance should change through GDI. for example I am creating custom label. Then how will i get my target. Problem is that I am only able to change the object at Paint event, here I can make changes to my object through GDI but I want When my object get focus or it is being clicked then I want to make changes via GDI. Any hint will be appreciated.

    M 1 Reply Last reply
    0
    • N Naveed727

      I am going to create a custom control and want to add an ability. When it get focused then It appearance should change through GDI. for example I am creating custom label. Then how will i get my target. Problem is that I am only able to change the object at Paint event, here I can make changes to my object through GDI but I want When my object get focus or it is being clicked then I want to make changes via GDI. Any hint will be appreciated.

      M Offline
      M Offline
      musefan
      wrote on last edited by
      #2

      can you not just invalidate the control when you handle other events such as click? userControl1.Invalidate(); this will cause the control to repaint itself, in which it will call the Paint event

      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