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. regd painting a form

regd painting a form

Scheduled Pinned Locked Moved C#
question
4 Posts 4 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.
  • K Offline
    K Offline
    karteek
    wrote on last edited by
    #1

    Hi, I have a text box on my form . I want to move the text box to the position where the user clicks. So I kept the location in variables and I am getting the coordinates of mouse click. How do I repaint the form so that the text box appears at the mouse click position. Karteek

    M T J 3 Replies Last reply
    0
    • K karteek

      Hi, I have a text box on my form . I want to move the text box to the position where the user clicks. So I kept the location in variables and I am getting the coordinates of mouse click. How do I repaint the form so that the text box appears at the mouse click position. Karteek

      M Offline
      M Offline
      Meysam Mahfouzi
      wrote on last edited by
      #2

      So, what is your problem? Just set the new X and Y values of the textbox and call the Refresh() method of the form if required.


      Don't forget, that's

      Persian Gulf

      not Arabian gulf!


      Murphy:
      Click Here![^]


      I'm thirsty like sun, more landless than wind...

      1 Reply Last reply
      0
      • K karteek

        Hi, I have a text box on my form . I want to move the text box to the position where the user clicks. So I kept the location in variables and I am getting the coordinates of mouse click. How do I repaint the form so that the text box appears at the mouse click position. Karteek

        T Offline
        T Offline
        TigerNinja_
        wrote on last edited by
        #3

        Invalidates a specific region of the control and causes a paint message to be sent to the control. [C#] public void Invalidate();


        R.Bischoff .NET, Kommst du mit?
        Great Freeware -> Abilon - Rss Reader | Zip Genius | SmartFTP

        1 Reply Last reply
        0
        • K karteek

          Hi, I have a text box on my form . I want to move the text box to the position where the user clicks. So I kept the location in variables and I am getting the coordinates of mouse click. How do I repaint the form so that the text box appears at the mouse click position. Karteek

          J Offline
          J Offline
          Judah Gabriel Himango
          wrote on last edited by
          #4

          Setting TextBox.Location will move the textbox to the new position, no calls to refresh required; the form will refresh itself automatically. #include "witty_sig.h"

          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