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. how to intercet ondraw event?

how to intercet ondraw event?

Scheduled Pinned Locked Moved C#
tutorialquestion
3 Posts 3 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.
  • S Offline
    S Offline
    Sasuko
    wrote on last edited by
    #1

    I want to intercet the ondraw event of textbox to avoid to draw the classic base with a trasparent one. How could i do?

    M 1 Reply Last reply
    0
    • S Sasuko

      I want to intercet the ondraw event of textbox to avoid to draw the classic base with a trasparent one. How could i do?

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

      Off the top of my head, if you derive your own class from a TextBox component, you could override the OnPaint method and not call base.OnPaint. Haven't done it before though, so it may be wrong, but I believe that is what you are looking for.

      J 1 Reply Last reply
      0
      • M methodincharge

        Off the top of my head, if you derive your own class from a TextBox component, you could override the OnPaint method and not call base.OnPaint. Haven't done it before though, so it may be wrong, but I believe that is what you are looking for.

        J Offline
        J Offline
        John Arlen1
        wrote on last edited by
        #3

        Yes, deriving a class from TextBox will let you handle the OnPaint and OnPaintBackground events yourself. However, creating a transparant textbox is a much more difficult endeavor than that. Two articles that offer solutions to this are: http://www.codeproject.com/cs/miscctrl/alphablendtextbox.asp[^] and http://www.codeproject.com/cs/miscctrl/TransparentTextBox.asp[^]

        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