youtuber Posted March 25, 2017 Share Posted March 25, 2017 this is my problem $GiveMessageButton = _Metro_CreateButton("Message Button", 432, 150, 75, 25) $rgrp_1 = 1 $Radio1 = _Metro_CreateRadio($rgrp_1, "Radio 1", 424, 40, 185, 22) $Radio2 = _Metro_CreateRadio($rgrp_1, "Radio 2", 424, 90, 185, 22) _Metro_RadioCheck($rgrp_1, $Radio1) Case $Radio1 _Metro_RadioCheck(1, $Radio1) Case $Radio2 _Metro_RadioCheck(1, $Radio2) Case $GiveMessageButton If _Metro_RadioCheck(1, $Radio1) Then ConsoleWrite("Radio 1 selected!" & @CRLF) Else ConsoleWrite("Radio 2 selected!" & @CRLF) EndIf Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 25, 2017 Moderators Share Posted March 25, 2017 youtuber, You do realise that almost no-one is likely to have the correct UDF to run that snippet? At the very least you could provide a link to the MetroGUI UDF. And what exactly is the problem you have - or are we supposed to guess? 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...
youtuber Posted March 26, 2017 Author Share Posted March 26, 2017 How To Read if radio button is selected Case $Radio1 _Metro_RadioCheck(1, $Radio1) Case $Radio2 _Metro_RadioCheck(1, $Radio2) Case $GiveMessageButton If GUICtrlRead($Radio1) = 1 Then ConsoleWrite("Radio 1 selected!" & @CRLF) Else ConsoleWrite("Radio 2 selected!" & @CRLF) EndIf expandcollapse popup#include <EditConstants.au3> #include <Array.au3> #include <File.au3> #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so /rm /pe #AutoIt3Wrapper_Res_HiDpi=y #NoTrayIcon #include "MetroGUI-UDF\MetroGUI_UDF.au3" _SetTheme("DarkTeal") _Metro_EnableHighDPIScaling() $Form1 = _Metro_CreateGUI("Form1", 615, 413, -1, -1, True) $Control_Buttons = _Metro_AddControlButtons(True, True, True, True, True) $GUI_CLOSE_BUTTON = $Control_Buttons[0] $GUI_MAXIMIZE_BUTTON = $Control_Buttons[1] $GUI_RESTORE_BUTTON = $Control_Buttons[2] $GUI_MINIMIZE_BUTTON = $Control_Buttons[3] $GUI_FULLSCREEN_BUTTON = $Control_Buttons[4] $GUI_FSRestore_BUTTON = $Control_Buttons[5] $GUI_MENU_BUTTON = $Control_Buttons[6] $GiveMessageButton = _Metro_CreateButton("Message Button", 432, 150, 75, 25) $rgrp_1 = 1 $Radio1 = _Metro_CreateRadio($rgrp_1, "Radio 1", 424, 40, 185, 22) $Radio2 = _Metro_CreateRadio($rgrp_1, "Radio 2", 424, 90, 185, 22) _Metro_RadioCheck($rgrp_1, $Radio1) Dim $MenuButtonsArray[1] = ["Exit"] GUICtrlSetResizing($Radio1, 768 + 1 + 32) GUICtrlSetResizing($Radio2, 768 + 1 + 32) GUICtrlSetResizing($GiveMessageButton, 768 + 8) GUISetState(@SW_SHOW) While 1 _Metro_HoverCheck_Loop($Form1) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $GUI_CLOSE_BUTTON _Metro_GUIDelete($Form1) Exit Case $GUI_MAXIMIZE_BUTTON GUISetState(@SW_MAXIMIZE) Case $GUI_RESTORE_BUTTON GUISetState(@SW_RESTORE) Case $GUI_MINIMIZE_BUTTON GUISetState(@SW_MINIMIZE) Case $GUI_FULLSCREEN_BUTTON, $GUI_FSRestore_BUTTON _Metro_FullscreenToggle($Form1, $Control_Buttons) Case $GUI_MENU_BUTTON Local $MenuSelect = _Metro_MenuStart($Form1, $GUI_MENU_BUTTON, 302, $MenuButtonsArray, "Segoe UI", 9, 0) Switch $MenuSelect Case "0" ConsoleWrite("Returned 5 = Exit button clicked." & @CRLF) _Metro_GUIDelete($Form1) Exit EndSwitch Case $Radio1 _Metro_RadioCheck(1, $Radio1) Case $Radio2 _Metro_RadioCheck(1, $Radio2) Case $GiveMessageButton If _Metro_RadioCheck(1, $Radio1) Then ConsoleWrite("Radio 1 selected!" & @CRLF) Else ConsoleWrite("Radio 2 selected!" & @CRLF) EndIf EndSwitch WEnd Link to comment Share on other sites More sharing options...
Skeletor Posted July 14, 2017 Share Posted July 14, 2017 Something like this? expandcollapse popup#include <EditConstants.au3> #include <Array.au3> #include <File.au3> #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so /rm /pe #AutoIt3Wrapper_Res_HiDpi=y #NoTrayIcon #include "MetroGUI_UDF.au3" _SetTheme("DarkTeal") _Metro_EnableHighDPIScaling() $Form1 = _Metro_CreateGUI("Form1", 300, 200, -1, -1, True) $Control_Buttons = _Metro_AddControlButtons(True, False, True, True, False) $GUI_CLOSE_BUTTON = $Control_Buttons[0] $GUI_MAXIMIZE_BUTTON = $Control_Buttons[1] $GUI_RESTORE_BUTTON = $Control_Buttons[2] $GUI_MINIMIZE_BUTTON = $Control_Buttons[3] ;$GUI_FULLSCREEN_BUTTON = $Control_Buttons[4] $GUI_FSRestore_BUTTON = $Control_Buttons[5] ;$GUI_MENU_BUTTON = $Control_Buttons[6] $rgrp_1 = 1 $Radio1 = _Metro_CreateRadio($rgrp_1, "Radio 1", 20, 90, 185, 22) $Radio2 = _Metro_CreateRadio($rgrp_1, "Radio 2",20, 120, 185, 22) _Metro_RadioCheck($rgrp_1, $Radio1) $GiveMessageButton = _Metro_CreateButton("Click Me", 20, 150, 100, 25) Dim $MenuButtonsArray[1] = ["Exit"] GUICtrlSetResizing($Radio1, 768 + 1 + 32) GUICtrlSetResizing($Radio2, 768 + 1 + 32) GUISetState(@SW_SHOW) While 1 _Metro_HoverCheck_Loop($Form1) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE, $GUI_CLOSE_BUTTON _Metro_GUIDelete($Form1) Exit Case $GUI_RESTORE_BUTTON GUISetState(@SW_RESTORE) Case $GUI_MINIMIZE_BUTTON GUISetState(@SW_MINIMIZE) Case $GUI_FSRestore_BUTTON _Metro_FullscreenToggle($Form1, $Control_Buttons) Case $Radio1 _Metro_RadioCheck(1, $Radio1) MsgBox(-1,"Radio 1 selected!", "You have chosen the first radio button") Case $Radio2 _Metro_RadioCheck(1, $Radio2) MsgBox(-1,"Radio 2 selected!", "You have chosen the second radio button") Case $GiveMessageButton MsgBox(-1,"Thank You for Clicking", "You clicked me") EndSwitch WEnd Kind RegardsSkeletor "Coffee: my defense against going postal." Microsoft Office Splash Screen | Basic Notepad Program (Beginner) | Transparent Splash Screen | Full Screen UI 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