Results 1 to 2 of 2

Thread: converting label to textbox

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2006
    Posts
    607

    converting label to textbox

    I am trying to acheive something like the vb functionality. (if you click on the title of your thread it turns into a textbox for quick editing).

    Would this be a possible solution:

    Inherit from textbox.
    Add a subroutine that checks whether textbox is readonly. If its readonly, display a label with the same text.
    If i handle the label click event, I can change the textbox to its normal property

  2. #2
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: converting label to textbox

    You can create a custom control which consists of a label and a hidden textbox. Handle the label.click event and show the textbox, hide the label. Handle the textbox.Keypress and leave event such that if the user presses the enter key or leave the textbox, you set the label text = the textbox.text then hide the textbox and show the label again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width