Initialize a List Box
-
Hi, Still trying to get used to programming, and still need a little help. I asked a few questions yesterday about a texteditor, but since have changed my approach. I wanted to know how to initialize a List Box to have text in it everytime the dialog starts up. Is this possible? If it is, is there a way to space out the text that I want to appear? I want it to look like this if possible:
Team1 Team 2 Team 3 Team 4
Thanks in advance!
-
Hi, Still trying to get used to programming, and still need a little help. I asked a few questions yesterday about a texteditor, but since have changed my approach. I wanted to know how to initialize a List Box to have text in it everytime the dialog starts up. Is this possible? If it is, is there a way to space out the text that I want to appear? I want it to look like this if possible:
Team1 Team 2 Team 3 Team 4
Thanks in advance!
-
Silly me....I got the text to come up.;P Can anyone help with the formatting though? Thanks again
what do you mean by 'formatting?' if youre trying to get strings into a listbox, you can use
My_List_Box.AddString("hello");
if you mean turning off alphabetical sorting of the contents of the listbox, in the resource editor, witht he listbox selected, look in the properties window and set the 'Sort' value to False (or off, depending). is that what you mean? *.* -
Silly me....I got the text to come up.;P Can anyone help with the formatting though? Thanks again
How you want the data formatted will govern whether you want/need to use a list box, list control, or a grid control. Although it's possible to make a list box look like it has columns, it remains a one-column control that uses tab stops to separate the columns.
-
Silly me....I got the text to come up.;P Can anyone help with the formatting though? Thanks again
Sorry for not being clear... I would like to have the words spaced out in the line of text. Just so that it is easier to read. I want it so that I do not have to manually hit the space bar between the words that i am gonna enter. Some of the information going on the lines are spaced further in that another like in the chart below. Ideally I want my dialog box to look exactly like this:
Team 1 Team 2 Team 3 Team 4
Game 1 80 69
Game 2 79 70
Game 3 55 73
Game 4 73 82Player #22 from Team 3 is the MVP of the tournament.
He lead the team in points, rebounds, assists and steals.
He also led the tournament in points (33.2), assists (8.9), and steals (3.2)I thought about using a list control, but i couldn't get the last 3 sentences to appear across the columns. THANKS IN ADVANCE!!!
-
Sorry for not being clear... I would like to have the words spaced out in the line of text. Just so that it is easier to read. I want it so that I do not have to manually hit the space bar between the words that i am gonna enter. Some of the information going on the lines are spaced further in that another like in the chart below. Ideally I want my dialog box to look exactly like this:
Team 1 Team 2 Team 3 Team 4
Game 1 80 69
Game 2 79 70
Game 3 55 73
Game 4 73 82Player #22 from Team 3 is the MVP of the tournament.
He lead the team in points, rebounds, assists and steals.
He also led the tournament in points (33.2), assists (8.9), and steals (3.2)I thought about using a list control, but i couldn't get the last 3 sentences to appear across the columns. THANKS IN ADVANCE!!!
Use an edit control with a fixed-space font.
-
Use an edit control with a fixed-space font.
Hi, I am really new to programming, and do not fully understand how to do this. (The fix spaced font) Can you possible give more details on how to do this? Will this get my "table" to look exactly how i want it? Thanks again. Sorry for being slow with this. Mechanical Engineers are not the best programmers! ;P
-
Hi, I am really new to programming, and do not fully understand how to do this. (The fix spaced font) Can you possible give more details on how to do this? Will this get my "table" to look exactly how i want it? Thanks again. Sorry for being slow with this. Mechanical Engineers are not the best programmers! ;P
Just as an example, if you had a dialog box with an edit control, you could put the following in the dialog's OnInitDialog() method:
m_font.CreateStockObject(ANSI_FIXED_FONT); m_edit.SetFont(&m_font);
Now you just format each line that is added to the edit control. -
Hi, Still trying to get used to programming, and still need a little help. I asked a few questions yesterday about a texteditor, but since have changed my approach. I wanted to know how to initialize a List Box to have text in it everytime the dialog starts up. Is this possible? If it is, is there a way to space out the text that I want to appear? I want it to look like this if possible:
Team1 Team 2 Team 3 Team 4
Thanks in advance!
Use CListCtrl instead of CListBox. With the List Control, you can create columns. In your case, you need to create 4 columns and add the data to each column individually... Mustafa Demirhan http://www.macroangel.com Sonork ID 100.9935:zoltrix
They say I'm lazy but it takes all my time
-
Use CListCtrl instead of CListBox. With the List Control, you can create columns. In your case, you need to create 4 columns and add the data to each column individually... Mustafa Demirhan http://www.macroangel.com Sonork ID 100.9935:zoltrix
They say I'm lazy but it takes all my time
Hi, I tried doing that, but is there a way for me to insert the 3 sentences that follow the chart and span them over the columns. I was originally using the list control, but could not find a way to do that. Any help would be appreciated. Thanks in advance