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 / C++ / MFC
  4. List Control with default text

List Control with default text

Scheduled Pinned Locked Moved C / C++ / MFC
comtutorial
9 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.
  • P Offline
    P Offline
    parichaybp
    wrote on last edited by
    #1

    Hi, I have created a List Control. I have to add the text by default by which the user can modify the text as required. List control ID :- IDC_EXCLUDE_FILTERS_LIST Type :- CListCtrl Member :- m_EXCLUDE_FILTERS_LIST I have to add the folowing text by default when the Dialog window loads. *.exp *.ilk *.res *.trg *.tlh *.idb *.pdb *.pch *.opt *.lib "*\Deleted Items\*" *.cab *.mov *.mp3 *.swf *.psp *.bmp *.chi *.chm *.com *.dll *.exe *.gif *.hlp *.ivi *.ivt *.ix *.jpeg *.jpg *.msi *.nl.mpeg *.mpg *.ram *.rm Can anyone please tell me how to add the default text to the list box & also user can edit the text and also remove the text.. I dnt know properly that i have to Edit Box or List box. but the text should be multiple lines where the user can edit the text. Regards, Parichay.

    K D 2 Replies Last reply
    0
    • P parichaybp

      Hi, I have created a List Control. I have to add the text by default by which the user can modify the text as required. List control ID :- IDC_EXCLUDE_FILTERS_LIST Type :- CListCtrl Member :- m_EXCLUDE_FILTERS_LIST I have to add the folowing text by default when the Dialog window loads. *.exp *.ilk *.res *.trg *.tlh *.idb *.pdb *.pch *.opt *.lib "*\Deleted Items\*" *.cab *.mov *.mp3 *.swf *.psp *.bmp *.chi *.chm *.com *.dll *.exe *.gif *.hlp *.ivi *.ivt *.ix *.jpeg *.jpg *.msi *.nl.mpeg *.mpg *.ram *.rm Can anyone please tell me how to add the default text to the list box & also user can edit the text and also remove the text.. I dnt know properly that i have to Edit Box or List box. but the text should be multiple lines where the user can edit the text. Regards, Parichay.

      K Offline
      K Offline
      keerthikaaa
      wrote on last edited by
      #2

      hai parichay for this u can use combo box instead of list box or edit box where u can enter the list before and u can edit while runtime :)

      P 2 Replies Last reply
      0
      • K keerthikaaa

        hai parichay for this u can use combo box instead of list box or edit box where u can enter the list before and u can edit while runtime :)

        P Offline
        P Offline
        parichaybp
        wrote on last edited by
        #3

        Hi, Thanks for the reply.. But in the Edit box , how to display the text in multiple line ???

        K 1 Reply Last reply
        0
        • K keerthikaaa

          hai parichay for this u can use combo box instead of list box or edit box where u can enter the list before and u can edit while runtime :)

          P Offline
          P Offline
          parichaybp
          wrote on last edited by
          #4

          keerthikaaa i cant use the Combo Box, i can use Edit box or list control or list Box.

          K 1 Reply Last reply
          0
          • P parichaybp

            Hi, Thanks for the reply.. But in the Edit box , how to display the text in multiple line ???

            K Offline
            K Offline
            keerthikaaa
            wrote on last edited by
            #5

            hai parichay to display mutliple lines u can set the property of the edit box as follows in the edit box properties->styles->mutliline checked :)

            P 1 Reply Last reply
            0
            • P parichaybp

              keerthikaaa i cant use the Combo Box, i can use Edit box or list control or list Box.

              K Offline
              K Offline
              keerthikaaa
              wrote on last edited by
              #6

              hai parichay look at this link.it may help u www.codeproject.com/listctrl/listctrldemo.asp

              1 Reply Last reply
              0
              • K keerthikaaa

                hai parichay to display mutliple lines u can set the property of the edit box as follows in the edit box properties->styles->mutliline checked :)

                P Offline
                P Offline
                parichaybp
                wrote on last edited by
                #7

                I just create a edit box with m_EDIT member of Type CString also checked multiline and i declared m_EDIT = "*.exp *.ilk *.res *.trg *.tlh *.idb *.pdb *.pch *.opt *.lib "*\Deleted Items\*" *.cab *.mov *.mp3 *"; i am gettling lots of erro that i cant use * etc can u please tell me how to do it? --------------------Configuration: DesktopSearch - Win32 Debug-------------------- Compiling... UpdateDlg.cpp D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2017: illegal escape sequence D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2065: 'Deleted' : undeclared identifier D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2017: illegal escape sequence D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2296: '*' : illegal, left operand has type 'char [61]' D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2146: syntax error : missing ';' before identifier 'Items' D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2065: 'Items' : undeclared identifier D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2297: '*' : illegal, right operand has type 'char [21]' Error executing cl.exe. DesktopSearch.exe - 7 error(s), 0 warning(s)

                N 1 Reply Last reply
                0
                • P parichaybp

                  I just create a edit box with m_EDIT member of Type CString also checked multiline and i declared m_EDIT = "*.exp *.ilk *.res *.trg *.tlh *.idb *.pdb *.pch *.opt *.lib "*\Deleted Items\*" *.cab *.mov *.mp3 *"; i am gettling lots of erro that i cant use * etc can u please tell me how to do it? --------------------Configuration: DesktopSearch - Win32 Debug-------------------- Compiling... UpdateDlg.cpp D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2017: illegal escape sequence D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2065: 'Deleted' : undeclared identifier D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2017: illegal escape sequence D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2296: '*' : illegal, left operand has type 'char [61]' D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2146: syntax error : missing ';' before identifier 'Items' D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2065: 'Items' : undeclared identifier D:\Parichay\DesktopSearch\UpdateDlg.cpp(168) : error C2297: '*' : illegal, right operand has type 'char [21]' Error executing cl.exe. DesktopSearch.exe - 7 error(s), 0 warning(s)

                  N Offline
                  N Offline
                  Nishad S
                  wrote on last edited by
                  #8

                  Use \\ for getting a single \ - NS -

                  1 Reply Last reply
                  0
                  • P parichaybp

                    Hi, I have created a List Control. I have to add the text by default by which the user can modify the text as required. List control ID :- IDC_EXCLUDE_FILTERS_LIST Type :- CListCtrl Member :- m_EXCLUDE_FILTERS_LIST I have to add the folowing text by default when the Dialog window loads. *.exp *.ilk *.res *.trg *.tlh *.idb *.pdb *.pch *.opt *.lib "*\Deleted Items\*" *.cab *.mov *.mp3 *.swf *.psp *.bmp *.chi *.chm *.com *.dll *.exe *.gif *.hlp *.ivi *.ivt *.ix *.jpeg *.jpg *.msi *.nl.mpeg *.mpg *.ram *.rm Can anyone please tell me how to add the default text to the list box & also user can edit the text and also remove the text.. I dnt know properly that i have to Edit Box or List box. but the text should be multiple lines where the user can edit the text. Regards, Parichay.

                    D Offline
                    D Offline
                    David Crow
                    wrote on last edited by
                    #9

                    parichaybp wrote:

                    I have created a List Control. I have to add the text by default by which the user can modify the text as required.

                    I've no idea what you are trying to say here.

                    parichaybp wrote:

                    I have to add the folowing text by default when the Dialog window loads.

                    What do you mean "by default?" What control do you want this text added to? If it's a list control, please explain in more detail as that control can be displayed in many different formats (e.g., report, list, icon).

                    parichaybp wrote:

                    Can anyone please tell me how to add the default text to the list box

                    Now you are using a listbox?

                    parichaybp wrote:

                    ...also user can edit the text and also remove the text..

                    Do you need an edit control for this?


                    "Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain

                    "There is no death, only a change of worlds." - Native American Proverb

                    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