NewBie_2018 Posted November 27, 2018 Posted November 27, 2018 Hello Before start asking question, I apologize for my poor english (So I'm writing this topic using translator ) This is my question Among many volumes in computer, I want to get the letter of volume. So I wrote this code expandcollapse popup#include <ButtonConstants.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) $Form1 = GUICreate("title", 291, 246, 184, 261) GUISetOnEvent($GUI_EVENT_CLOSE, "Exitapp") $Combo1 = GUICtrlCreateCombo("select volume", 16, 32, 257, 25, 0x0003) GUICtrlCreateGroup("", -99, -99, 1, 1) $Button1 = GUICtrlCreateButton("Check", 16, 70, 257, 25) GUICtrlSetOnEvent($Button1, "Func_Check") GUISetState(@SW_SHOW) Local $var = DriveGetDrive("All") If Not @error Then For $i = 1 To $var[0] $DriveType = DriveGetType($var[$i]) If $DriveType = "Removable" Or $DriveType = "Fixed" Then $letter = StringUpper($var[$i]) GUICtrlSetData($Combo1, $letter) EndIf Next EndIf While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd ;;;;;;;;;;;;;;;;;;;;;;;;; UDF Area ;;;;;;;;;;;;;;;;;;;;;;;;; Func Func_Check() MsgBox(0, "test", $Combo1) EndFunc Func Exitapp() Exit EndFunc but, When I click the button, I can see only " 3 " According to a lot of topics what i saw, in case using " | ", I can get the value what I want. But I have no idea how to use " | " in my code. If there's a good way I do not know, please let me know. Thank you for reading. Have a good day.
Moderators JLogan3o13 Posted November 27, 2018 Moderators Posted November 27, 2018 (edited) @NewBie_2018 Welcome to the forum. Try changing this: MsgBox(0, "test", $Combo1) To this: MsgBox(0, "test", GUICtrlRead($Combo1)) See the help file on GUICtrlRead for more info. Edited November 27, 2018 by JLogan3o13 NewBie_2018 and gwinter 1 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
NewBie_2018 Posted November 27, 2018 Author Posted November 27, 2018 omg, I'm so sorry for choosing the wrong place In this case, do I have to write one more in GUI Help and Support?
Moderators JLogan3o13 Posted November 27, 2018 Moderators Posted November 27, 2018 It is not a problem, we can move the topic. Did my suggestion fix the issue for you? NewBie_2018 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
NewBie_2018 Posted November 27, 2018 Author Posted November 27, 2018 @JLogan3o13 Thank you so much ! I think the most problem is my poor searching skill I should study English hard too
FrancescoDiMuro Posted November 27, 2018 Posted November 27, 2018 @NewBie_2018 Maybe you were asking for set more values in a ComboBox? If so, just use GUICtrlSetData() with the pipe symbol " | ", which means "new row" in your ComboBox list NewBie_2018 1 Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
NewBie_2018 Posted November 27, 2018 Author Posted November 27, 2018 @FrancescoDiMuro Thank you for reply ! My problem is solved ! It was because of my poor searching skill
FrancescoDiMuro Posted November 27, 2018 Posted November 27, 2018 @NewBie_2018 Google Translate Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
NewBie_2018 Posted November 27, 2018 Author Posted November 27, 2018 @FrancescoDiMuro Sometimes I use that, but that's not satisfactory There are some unnatural sentences, so I have to modify them If I didn't know English at all, I could not even search it
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