How do I make an un-editable table?

This is a discussion on How do I make an un-editable table? within the Windows Programming forums, part of the Platform Specific Boards category; http://www.image.imgfreak.com/access.JPG (Edit: I Guess I forgot how to use img tags?) Obviously I'm not looking for anything super in depth, ...

  1. #1
    I am he who is the man! Stan100's Avatar
    Join Date
    Sep 2002
    Posts
    361

    Question How do I make an un-editable table?

    http://www.image.imgfreak.com/access.JPG
    (Edit: I Guess I forgot how to use img tags?)

    Obviously I'm not looking for anything super in depth, more like a simple columns and rows like thing. I don't need the user to be able to change the text, I just thought it would be a convienient way to display information.

    I've had a bad feeling that this was going to involve MFC, but I figured if it can be done in that it can be done in win32. Can anyone help me out? Thanks
    Stan The Man. Beatles fan

    When I was a child,
    I spoke as a child,
    I thought as a child,
    I reasoned as a child.
    When I became a man,
    I put childish ways behind me"
    (the holy bible, Paul, in his first letter to the Cor. 13:11)

  2. #2
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,263
    You're not being terribly helpful not describing what it is you actually want.

    One place to start I would think would be to init common controls and create a listview window as a child to your own, giving it the LVS_REPORT style. This'll give you something akin to what Explorer shows you when you select "Detail" from the View menu.
    Of course, it won't look right initially because there are no column headers defined.

    Read up on List View Controls for more info on doing this.

  3. #3
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    Just a quick addition. You can turn on gridlines for the list-view by using:
    Code:
    ListView_SetExtendedListViewStyleEx(hwndList, LVS_EX_GRIDLINES, LVS_EX_GRIDLINES);
    This should give you something very similar to the Access screenshot. Other funstions you will need are ListView_InsertColumn, ListView_InsertItem and ListView_SetItemText.

    You can find a list-view sample here and more samples at FoosYerDoos.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. trying to make a hash table......trouble w/ memory?
    By cuizy in forum C Programming
    Replies: 3
    Last Post: 05-11-2009, 04:47 PM
  2. Duplicate at Hash Table
    By DarrenY in forum C Programming
    Replies: 1
    Last Post: 05-10-2007, 02:31 AM
  3. Win32 Common Controls in C++, how do i make and use them?
    By C+noob in forum Windows Programming
    Replies: 6
    Last Post: 01-09-2006, 10:53 AM
  4. how do i make a mathematical table using loops.
    By gad n' gaz in forum C Programming
    Replies: 13
    Last Post: 10-18-2005, 02:15 PM
  5. How to make a multiplication table up to 10*10=100?
    By Unregistered in forum C++ Programming
    Replies: 8
    Last Post: 01-11-2002, 09:07 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21