<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: 3 radio buttons instead of 2 in a messagebox? in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/3-radio-buttons-instead-of-2-in-a-messagebox/m-p/10757240#M43599</link>
    <description>&lt;P&gt;Love coding.&lt;/P&gt;
&lt;P&gt;You want 2 buttons? Here's a line of code.&lt;/P&gt;
&lt;P&gt;You want 3? Well that's 77 lines now&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":face_with_tears_of_joy:"&gt;😂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for everyone's help, need to work out how to integrate this now.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Nov 2021 06:42:39 GMT</pubDate>
    <dc:creator>SharkDesign</dc:creator>
    <dc:date>2021-11-15T06:42:39Z</dc:date>
    <item>
      <title>3 radio buttons instead of 2 in a messagebox?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/3-radio-buttons-instead-of-2-in-a-messagebox/m-p/10753625#M43594</link>
      <description>&lt;P&gt;The standard code is setup as a boolean so there's only two options, is there a way to have 3?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;booleanParam&lt;/SPAN&gt; = &lt;SPAN&gt;InputRadioBox&lt;/SPAN&gt;(&lt;SPAN&gt;"Prompt"&lt;/SPAN&gt;, &lt;SPAN&gt;"Button1 Label"&lt;/SPAN&gt;, &lt;SPAN&gt;"Button2 Label"&lt;/SPAN&gt;, &lt;SPAN&gt;booleanParam&lt;/SPAN&gt;, &lt;SPAN&gt;Title&lt;/SPAN&gt; := &lt;SPAN&gt;"Title"&lt;/SPAN&gt;)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know you can launch a global form and do it that way, but I don't want to clutter the global form tab.&lt;/P&gt;
&lt;P&gt;You can use inputlist, but I find that messagebox really ugly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 14:46:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/3-radio-buttons-instead-of-2-in-a-messagebox/m-p/10753625#M43594</guid>
      <dc:creator>SharkDesign</dc:creator>
      <dc:date>2021-11-12T14:46:38Z</dc:date>
    </item>
    <item>
      <title>Re: 3 radio buttons instead of 2 in a messagebox?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/3-radio-buttons-instead-of-2-in-a-messagebox/m-p/10753714#M43595</link>
      <description>&lt;P&gt;Yes you can.&amp;nbsp; Just not with an InputRadioBox.&amp;nbsp; If you don't need textual or selection functionality, and just need 3 button functionality, you can use a regular MessageBox.Show() or MsgBox(), then specify that it has 3 buttons (for example Yes, No, &amp;amp; Cancel or Abort, Retry, &amp;amp; Ignore).&amp;nbsp; You can't change the labels of those buttons, but you can check the &lt;A href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.visualbasic.msgboxresult?view=net-5.0" target="_blank" rel="noopener"&gt;MsgBoxResult&lt;/A&gt; afterwords to determine which button the user clicked (if any) and decide what to do about each possible button click.&amp;nbsp; I have done this many times.&amp;nbsp; Of course, I usually have a multi-line message describing what each button click will do, if other users will be interacting with it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN style="background-color: green; color: white;"&gt;&lt;STRONG&gt;ACCEPT SOLUTION&lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click (LIKE or KUDOS) &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;.&lt;/P&gt;
&lt;P&gt;If you want and have time, I would appreciate your Vote(s) for &lt;A href="https://forums.autodesk.com/t5/forums/recentpostspage/post-type/message/interaction-style/idea/user-id/7812054/" target="_blank"&gt;My IDEAS &lt;/A&gt; &lt;span class="lia-unicode-emoji" title=":light_bulb:"&gt;💡&lt;/span&gt; or you can Explore &lt;A href="https://knowledge.autodesk.com/profile/LTSUSR7HXMSAE/articles" target="_blank"&gt;My CONTRIBUTIONS &lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 15:30:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/3-radio-buttons-instead-of-2-in-a-messagebox/m-p/10753714#M43595</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2021-11-12T15:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: 3 radio buttons instead of 2 in a messagebox?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/3-radio-buttons-instead-of-2-in-a-messagebox/m-p/10753754#M43596</link>
      <description>&lt;P&gt;Here is a quickie example of what that might look like in an iLogic rule, using the MsgBox route.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;oAns = MsgBox("Click [YES] to ..." &amp;amp; vbCrLf &amp;amp; _
"Click [NO] to ..." &amp;amp; vbCrLf &amp;amp; _
"Click [CANCEL] to ...", vbYesNoCancel + vbQuestion, "CHOOSE ONE")
If oAns = vbYes Then
	MsgBox("You clicked the [YES] button.", , "")
	'or do something
ElseIf oAns = vbNo Then
	MsgBox("You clicked the [NO] button.", , "")
	'or do something else
ElseIf oAns = vbCancel Then
	MsgBox("You clicked the [CANCEL] button.", , "")
	'or do something else
End If&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 15:47:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/3-radio-buttons-instead-of-2-in-a-messagebox/m-p/10753754#M43596</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2021-11-12T15:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: 3 radio buttons instead of 2 in a messagebox?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/3-radio-buttons-instead-of-2-in-a-messagebox/m-p/10753782#M43597</link>
      <description>&lt;P&gt;Just another option, but definitely a more complicated one.&amp;nbsp; If you don't want to use a iLogic Form, or VBA UserForm, but you really need the buttons to have custom labels, and maybe need a more intuitive way of responding to each possible button click, you could create your own &lt;A href="https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.form?view=windowsdesktop-5.0" target="_blank" rel="noopener"&gt;Windows Form&lt;/A&gt; right within the rule code.&amp;nbsp; &lt;U&gt;&lt;STRONG&gt;&lt;A href="https://knowledge.autodesk.com/community/article/328361" target="_blank" rel="noopener"&gt;Here is a link&lt;/A&gt;&lt;/STRONG&gt;&lt;/U&gt; to one of my contribution posts where I demonstrate this (&lt;U&gt;&lt;STRONG&gt;&lt;A href="https://knowledge.autodesk.com/community/article/355976" target="_blank" rel="noopener"&gt;and another example&lt;/A&gt;&lt;/STRONG&gt;&lt;/U&gt;).&amp;nbsp; It can get complicated, but can be very nice when its done.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 16:11:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/3-radio-buttons-instead-of-2-in-a-messagebox/m-p/10753782#M43597</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2021-11-12T16:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: 3 radio buttons instead of 2 in a messagebox?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/3-radio-buttons-instead-of-2-in-a-messagebox/m-p/10753854#M43598</link>
      <description>&lt;P&gt;&amp;nbsp;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/510259"&gt;@SharkDesign&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is an example that is a modification of &lt;FONT color="#0000FF"&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-ilogic-api-vba-forum/creating-temporary-user-parameters-in-a-drawing-for-a-multi/m-p/10689366#M130083" target="_blank" rel="noopener"&gt;a checkbox example&lt;/A&gt;&lt;/FONT&gt; that I saw recently, provided by&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5011186"&gt;@JelteDeJong&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hope this helps.&lt;BR /&gt;Best of luck to you in all of your Inventor pursuits,&lt;BR /&gt;Curtis&lt;BR /&gt;&lt;A href="http://inventortrenches.blogspot.com" target="_blank" rel="noopener"&gt;http://inventortrenches.blogspot.com&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;AddReference "System.Drawing"
Imports System.ComponentModel
Imports System.Drawing
Imports System.Windows.Forms
Public Class WinForm
	Inherits System.Windows.Forms.Form

	Private _questions As List(Of String)
	Private _RadioButtons As List(Of RadioButton)	
	Public Sub New()
		_RadioButtons = New List(Of RadioButton)
		_questions = New List(Of String)
		' Add your questions here
		_questions.Add("Question 1")
		_questions.Add("Question 2")
		_questions.Add("Question 3")
		
		With Me
			.FormBorderStyle = FormBorderStyle.FixedToolWindow
			.StartPosition = FormStartPosition.CenterScreen
			.Width = 300
			.Height = _questions.Count * 20 + 100
			.TopMost = True
			.Font = New Font("Arial",10)
			.Text = "Question Form"
			.ShowInTaskbar = False
		End With
		Dim i = 0
		For Each question As String In _questions
			AddRadioButton(question, i * 20)
			i = i + 1
		Next
		Dim oButton1 As New Button()
		With oButton1			
			.Text = "Ok"
			.Top = Me.Height - 75
			.Left = Me.Width - 130
			.Width = 100
			.Height = 25
			.Enabled = True
			.AutoSize = False
		End With
		Me.Controls.Add(oButton1)
		AddHandler oButton1.Click, AddressOf oButton1_Click		
	End Sub
	
	Private Sub AddRadioButton(Text, i)
		Dim oRadioButton As New RadioButton()
		With oRadioButton
			.Text = Text
			.Top =  10 + i
			.Left = 10
			.AutoSize = True			
		End With
		Me.Controls.Add(oRadioButton)	
		_RadioButtons.Add(oRadioButton)
	End Sub	
  
	Private Sub oButton1_Click(ByVal oSender As System.Object, ByVal oEventArgs As System.EventArgs)
	
		For Each RadioButton As RadioButton In _RadioButtons
			MsgBox(RadioButton.Text &amp;amp; " = " &amp;amp; RadioButton.checked, , "iLogic")
		Next
		
		' Your code for can go here....		
		
		Me.Close()
	End Sub
End Class


Public Class RunMyForm
	Private Sub Main
		Dim oMyForm As New WinForm
		oMyForm.Show
	End Sub
End Class&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Nov 2021 16:44:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/3-radio-buttons-instead-of-2-in-a-messagebox/m-p/10753854#M43598</guid>
      <dc:creator>Curtis_Waguespack</dc:creator>
      <dc:date>2021-11-12T16:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: 3 radio buttons instead of 2 in a messagebox?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/3-radio-buttons-instead-of-2-in-a-messagebox/m-p/10757240#M43599</link>
      <description>&lt;P&gt;Love coding.&lt;/P&gt;
&lt;P&gt;You want 2 buttons? Here's a line of code.&lt;/P&gt;
&lt;P&gt;You want 3? Well that's 77 lines now&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":face_with_tears_of_joy:"&gt;😂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for everyone's help, need to work out how to integrate this now.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Nov 2021 06:42:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/3-radio-buttons-instead-of-2-in-a-messagebox/m-p/10757240#M43599</guid>
      <dc:creator>SharkDesign</dc:creator>
      <dc:date>2021-11-15T06:42:39Z</dc:date>
    </item>
  </channel>
</rss>

