nitekram Posted August 29, 2010 Share Posted August 29, 2010 I am trying to align text in a combo box - the problem is is that it does not align no matter what I have tried - this example is my last attemp and it correctly displays in the console window but not in the combo box - can someone show me what I am doing wrong? expandcollapse popup#include <GuiConstantsEx.au3> #include <WindowsConstants.au3> Local $data[20][2], $data2[20] Local $strintest = 0 $gui = GUICreate('', 260,410) $test = GUICtrlCreateCombo('', 0, 0, 250, 400, $WS_VSCROLL) GUISetState() For $i = 0 To UBound($data) - 1 For $j = 0 To Random(3, 10) $data[$i][0] &= Random('1', '7', 1) $data[$i][1] &= Random('1', '7', 1) Next Next For $g = 0 To UBound($data) - 1 If $strintest <= StringLen($data[$g][0]) Then $strintest = StringLen($data[$g][0]) Next $strintest += 5 For $l = 0 To UBound($data) - 1 If StringLen($data[$l][0]) <> $strintest Then Do $data[$l][0] &= ' ' Until StringLen($data[$l][0]) >= $strintest EndIf Next For $i = 0 To UBound($data) - 1 ConsoleWrite('!>' & $data[$i][0] & $data[$i][1] & @CRLF) GUICtrlSetData($test, $data[$i][0] & $data[$i][1]) Next While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 29, 2010 Moderators Share Posted August 29, 2010 nitekram,Just use a monospaced font for the combo like this: $test = GUICtrlCreateCombo('', 0, 0, 250, 400, $WS_VSCROLL) GUICtrlSetFont(-1, 10, Default, Default, "Courier New") ; <<<<<<<<<<<<<<<<<<<<<<<<Or you could use the new Consolas font which was designed to look less "clunky". M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
nitekram Posted August 29, 2010 Author Share Posted August 29, 2010 Sooooooo, I spent over 4 hours trying to figure this out and it was just the FONT - I feel stupid. Thanks for your help, once again. 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now