CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2009
    Posts
    103

    Limit what is shown in an editbox without changing data

    Not sure the best way to handle this, even if it can be done....

    Is there a way to "limit" what is shown in an EDITBOX while not physically changing the fields data?

    That is, if I have a EDITBOX, and the matching CString for that box contains a path/filename, can I only display the filename and not the path... BUT... leave the CString with the whole path/filename so I don't have to keep track of it?

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,430

    Re: Limit what is shown in an editbox without changing data

    Your CString can contain everything you want.
    You then set to the edit box only those part of CString you want to be shown.
    Just use SetWindowText/GetWindowText to set/get texts and extract/append text from/to the CString object.
    Victor Nijegorodov

  3. #3
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: Limit what is shown in an editbox without changing data

    Quote Originally Posted by pbrama View Post
    Is there a way to "limit" what is shown in an EDITBOX while not physically changing the fields data?
    Standard EDITBOX does not provide such functionality. You have to implement your own control for this.
    Best regards,
    Igor

  4. #4
    Ejaz's Avatar
    Ejaz is offline Elite Member Power Poster
    Join Date
    Jul 2002
    Location
    Lahore, Pakistan
    Posts
    4,211

    Re: Limit what is shown in an editbox without changing data

    Take a look at CFilterEdit

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

Featured