Jump to content

Howto Create Listbox Titles


Recommended Posts

I know how to Populate going downwards but how do i populate the listbox going across?

@shawnmstout

Have you not learned yet to post code you have tried?

Just from the very worthless description of what you want to do, I suspect that you mean a ListView (multi-column) and not a List (single-column). There are examples in the Help file and there is also a very good ListView UDF that also includes examples in the help file.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

@shawnmstout

Have you not learned yet to post code you have tried?

Just from the very worthless description of what you want to do, I suspect that you mean a ListView (multi-column) and not a List (single-column). There are examples in the Help file and there is also a very good ListView UDF that also includes examples in the help file.

sorry man, this is my first attempt at making a listbox so im quite new to this, like 10 minutes ago new, and its hard to look through the help file when you dont know exactly what your looking for.

Where do i find the ListView UDF at?

i know my code is a mess cause i was taking it from tray menus which i ended up maxing out, but here is what i got so far

Edited by shawnmstout
Link to comment
Share on other sites

attached test.au3

im simply trying to make a table with headers telling what the data is, and filling in the section below

Here is an example of how i wanted it to show

-----------------------------------------Drive #1------------------------------------

Label | Drive | FileSystem | Serial Number | Free Space | Total Space |

data | data | data | data | data | data |

-----------------------------------------Drive #2-----------------------------------

Label | Drive | FileSystem | Serial Number | Free Space | Total Space |

data | data | data | data | data | data |

where the data is, is where the information goes,

drive numbers = Header

next row = Column Titles

next row = data

hope this clarifies it, the reason why i chose listboxes is so you can scroll, if this isnt the best approach, please advice

test.au3

Edited by shawnmstout
Link to comment
Share on other sites

sorry man, this is my first attempt at making a listbox so im quite new to this, like 10 minutes ago new, and its hard to look through the help file when you dont know exactly what your looking for.

Where do i find the ListView UDF at?

i know my code is a mess cause i was taking it from tray menus which i ended up maxing out, but here is what i got so far

Okay, you didn't post or attach what you have so far so take a look in the help file >> User Defined Functions Reference >> GUIListViewManagement for the functions and examples. The UDF itself is in the Include folder created when you installed AutoIt.

Edit: I also should have pointed out that you may not evnen need the ListView UDF functionality. First look in the Help file >> Function Reference >> GUI management >> GUI Control Creation Then look for

GUICtrlCreateListview() and GUICtrlCreateListViewItem()

Edited by GEOSoft

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Okay, you didn't post or attach what you have so far so take a look in the help file >> User Defined Functions Reference >> GUIListViewManagement for the functions and examples. The UDF itself is in the Include folder created when you installed AutoIt.

Edit: I also should have pointed out that you may not evnen need the ListView UDF functionality. First look in the Help file >> Function Reference >> GUI management >> GUI Control Creation Then look for

GUICtrlCreateListview() and GUICtrlCreateListViewItem()

Thanks for Pointing Me in the Right Direction

Link to comment
Share on other sites

You also get the scroll ability with ListView Controls if The list exceeds the height of the control.

GUICreate("Test GUI", 700, 400)
$ListView = GUICtrlCreateListView("Label | Drive | FileSystem | Serial Number | " & _
"Free Space | Total Space ", 10, 10, 600, 80)
$aDrives = DriveGetDrive("All")
For $i = 1 To Ubound($aDrives) -1
    $sData = DriveGetLabel($aDrives[$i]) & "|" & StringUpper($aDrives[$i]) & "|"
    $sData &= DriveGetFileSystem($aDrives[$i]) & "|" & DriveGetSerial($aDrives[$i]) & "|"
    $sData &= DriveSpaceFree($aDrives[$i]) & "|" & DriveSpaceTotal($aDrives[$i])
    GUICtrlCreateListViewItem($sData, $ListView)
Next

GUISetState()
While 1
    If GUIGetMsg() = -3 Then Exit
Wend

If you need to set the column widths then see _GUICtrlListView_SetColumnWidth() in the UDF section I pointed you to.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

Here is what i got so far, i posted another topic in the main channel, im definitely doing something wrong

I see you paid attention to the part where I said you may not need the UDF. Take a look at the code I posted. See any differences?

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

I see you paid attention to the part where I said you may not need the UDF. Take a look at the code I posted. See any differences?

that would work but its not putting the data into columns so if the field is alot bigger than the title then its not going to align correctly

Link to comment
Share on other sites

that would work but its not putting the data into columns so if the field is alot bigger than the title then its not going to align correctly

no i was wrong, how does | tell it its the next column?

that is so much easier

Edited by shawnmstout
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...