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 Clear tabpage text created by graphic object

How to Clear tabpage text created by graphic object

Scheduled Pinned Locked Moved C#
questiongraphicshelptutorial
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.
  • P Offline
    P Offline
    printscreen12345
    wrote on last edited by
    #1

    I have created a graphic object on a tabpage as follows: Graphics g = null; g = tabPage1.CreateGraphics(); g.DrawString(str_1, fnt, brsh, x, y); g.Dispose(); str_1 has been displayed successfully. But how do I clear the existing text and display another text on the tabpage (tabpage.Controls.Clear() didn't work)? At the moment, the problem is that the new text is displayed on top of the existing ones.

    L 1 Reply Last reply
    0
    • P printscreen12345

      I have created a graphic object on a tabpage as follows: Graphics g = null; g = tabPage1.CreateGraphics(); g.DrawString(str_1, fnt, brsh, x, y); g.Dispose(); str_1 has been displayed successfully. But how do I clear the existing text and display another text on the tabpage (tabpage.Controls.Clear() didn't work)? At the moment, the problem is that the new text is displayed on top of the existing ones.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You must draw the existing string using background color to clear it.

      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