Table trouble

Discussion in 'Questions (Windows Mobile)' started by RandomCoder, May 8, 2007.

  1. RandomCoder

    RandomCoder Well-Known Member Licensed User

    I'm currently in the process of developing a Hi-Score table for my game. In doing this I've come across a couple of problems -

    1) Is it possible to highlight a particular row of the table, either by making the font bold or changing the font colour?

    2) Can the background colour of the table be changed? My table is called "ScoresTable", and I've tried ScoresTable.Color=cWhite but this only appears to change the background colour of the cells, the rest of the table is still dark grey.

    3) Below is a section of my code that I use to set the headers
    ScoresTable.AddCol(cString,"Pos",ScoresTable.Width*.15,True)
    ScoresTable.AddCol(cString,"Level",ScoresTable.Width*.2,False)
    ScoresTable.AddCol(cString,"Accuracy",ScoresTable.Width*.3,False)
    ScoresTable.AddCol(cString,"Date",ScoresTable.Width*.35,False)
    I set the width of each header/column as a percentage of the table width (shown in bold) but this causes the scroll bar to be displayed - WHY:confused:
    To prevent the scroll bar from showing I have too make one of the columns slightly smaller.

    Thanks in advance,
    RandomCoder
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    The Table control is based on the .Net DataGrid control.
    Unfortunately it doesn't allow changing the style of a specific row or cell and it doesn't allow (on the device) to change the background color (behind the rows).

    You should leave enough space for the borders.
     
  3. RandomCoder

    RandomCoder Well-Known Member Licensed User

    Thanks Erel.

    Do you have any better ways of creating a Hi-Score table, I did consider arranging labels on a form that were linked to a hidden table. What do you think??

    Thanks,
    RandomCoder.

    PS. If I can make it work well then I thought it would make quite a nice code sample for others to use.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    I think that it will be better.
     
  5. Cableguy

    Cableguy Expert Licensed User

    Hi, randomCoder...

    I was going to suggest a txt file to store/read the data, but it ends up a similar way as yours...
    To "format" the results i would defenetly go with labels and the formlib formating capabilities...
     
  6. RandomCoder

    RandomCoder Well-Known Member Licensed User

    Cheers for your input, I'll give it a go. My only reservation is whether it will be slow at loading, but I'll soon find out.

    Regards,
    RandomCoder
     
Loading...