<?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 DotNet and messagebox problems in 3ds Max Programming Forum</title>
    <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/dotnet-and-messagebox-problems/m-p/4118714#M23319</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have recently updated one of my scripts to include some dotNet elements in its rollouts &amp;amp;#40;bold &lt;BR /&gt;and colorful fonts&amp;amp;#41;.&lt;BR /&gt;&lt;BR /&gt;The script has two pickbuttons that let you choose objects in the scene. If the picked objects do not have the right modifiers for the script to work, or the right controller - it pops up a messagebox saying that the object is invalid. &lt;BR /&gt;&lt;BR /&gt;That worked just fine before dotNet. Now that dotNet is introduced - I get the messageboxes fine - but I lose the ability to interact again with my dialog rollout. All the GUI functions on it are dead. If I disable the messagebox - all works fine.&lt;BR /&gt;&lt;BR /&gt;What is it about dotNet and messageboxes that prevents the re-use of the script - so that the user can pick the correct object if the previous one turned up to be wrong?&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
    <pubDate>Thu, 15 Oct 2009 13:37:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2009-10-15T13:37:49Z</dc:date>
    <item>
      <title>DotNet and messagebox problems</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/dotnet-and-messagebox-problems/m-p/4118714#M23319</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have recently updated one of my scripts to include some dotNet elements in its rollouts &amp;amp;#40;bold &lt;BR /&gt;and colorful fonts&amp;amp;#41;.&lt;BR /&gt;&lt;BR /&gt;The script has two pickbuttons that let you choose objects in the scene. If the picked objects do not have the right modifiers for the script to work, or the right controller - it pops up a messagebox saying that the object is invalid. &lt;BR /&gt;&lt;BR /&gt;That worked just fine before dotNet. Now that dotNet is introduced - I get the messageboxes fine - but I lose the ability to interact again with my dialog rollout. All the GUI functions on it are dead. If I disable the messagebox - all works fine.&lt;BR /&gt;&lt;BR /&gt;What is it about dotNet and messageboxes that prevents the re-use of the script - so that the user can pick the correct object if the previous one turned up to be wrong?&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Thu, 15 Oct 2009 13:37:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/dotnet-and-messagebox-problems/m-p/4118714#M23319</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-15T13:37:49Z</dc:date>
    </item>
    <item>
      <title>Re: DotNet and messagebox problems</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/dotnet-and-messagebox-problems/m-p/4118715#M23320</link>
      <description>OK - it's much easier to explain with an example.&lt;BR /&gt;Please copy and use the code below. A simple interface with radiobuttons and pickbuttons. The radiobuttons work, as well as the pickbutton. Once you select an object with the pick button &amp;amp;#40;which will not be called "test01"&amp;amp;#41;, the script will pop up a messagebox claiming it's the wrong object. From there you can't go back to the script to choose again, and the radiobuttons won't work.&lt;BR /&gt;&lt;BR /&gt;BTW - I've found that I need to disable the groupbox - otherwise I get the same behavior of not being able to interact with the interface.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;&lt;BR /&gt;rollout dotNetProblem "dotNet Problem" width:278 height:170&lt;BR /&gt;&amp;amp;#40;&lt;BR /&gt;   dotNetControl grpType "groupBox" pos: enabled:false&lt;BR /&gt;   radiobuttons objectType labels:#&amp;amp;#40;"Mesh", "Spline"&amp;amp;#41; default:1 columns:2&lt;BR /&gt;   label lObj "Picked: Mesh"&lt;BR /&gt;   dotNetControl lblTitle "label"&lt;BR /&gt;   pickButton bPick "Pick Object" pos: width:100 height:20&lt;BR /&gt;   button bGo "Go" pos: width:120 height:30 enabled:false&lt;BR /&gt;&lt;BR /&gt;   on dotNetProblem open do&lt;BR /&gt;   &amp;amp;#40;&lt;BR /&gt;      lblTitle.text = "dotNet Title"&lt;BR /&gt;      grpType.text = "dotNet groupbox title:\t"&lt;BR /&gt;      grpType.width = 268&lt;BR /&gt;      grpType.height = 150&lt;BR /&gt;      bgcolor = &amp;amp;#40;colorman.getcolor #background&amp;amp;#41;*255&lt;BR /&gt;      dnbgcolor = &amp;amp;#40;DotNetClass  "System.Drawing.Color"&amp;amp;#41;.FromArgb bgcolor bgcolor bgcolor&lt;BR /&gt;      lblTitle.BackColor = dnbgcolor&lt;BR /&gt;      grpType.BackColor = dnbgcolor&lt;BR /&gt;      dnFontStyle = dotNetClass "System.Drawing.FontStyle"&lt;BR /&gt;      myFontStyle = dotnet.combineenums dnFontStyle.bold --dnFontStyle.italic&lt;BR /&gt;      boldDNfont = dotNetObject "System.Drawing.Font" "MS Sans Serif" 8 myFontStyle&lt;BR /&gt;      lblTitle.Font = boldDNfont&lt;BR /&gt;      grpType.Font = boldDNfont&lt;BR /&gt;      grpType.ForeColor = &amp;amp;#40;DotNetClass  "System.Drawing.Color"&amp;amp;#41;.FromArgb  0 0 100&lt;BR /&gt;   &amp;amp;#41;&lt;BR /&gt;&lt;BR /&gt;   on objectType changed state do&lt;BR /&gt;   &amp;amp;#40;&lt;BR /&gt;      if &amp;amp;#40;objectType.state ==1&amp;amp;#41; then lObj.text = "Picked: Mesh"&lt;BR /&gt;      if &amp;amp;#40;objectType.state ==2&amp;amp;#41; then lObj.text = "Picked: Spline"&lt;BR /&gt;   &amp;amp;#41;&lt;BR /&gt; &lt;BR /&gt;   on bPick picked obj do&lt;BR /&gt;   &amp;amp;#40;&lt;BR /&gt;      if obj != undefined then&lt;BR /&gt;      &amp;amp;#40;&lt;BR /&gt;         if obj.name != "test01" then&lt;BR /&gt;         &amp;amp;#40;&lt;BR /&gt;            messagebox "Object is not \"test01\"" -- &amp;lt;- Try commenting this out to make it work&lt;BR /&gt;            obj = undefined&lt;BR /&gt;            return 0&lt;BR /&gt;         &amp;amp;#41; else &amp;amp;#40;&lt;BR /&gt;            bGo.enabled = true&lt;BR /&gt;            bPick.text=obj.name&lt;BR /&gt;         &amp;amp;#41;&lt;BR /&gt;      &amp;amp;#41;&lt;BR /&gt;      else &amp;amp;#40;return 0&amp;amp;#41;&lt;BR /&gt;   &amp;amp;#41;&lt;BR /&gt; &lt;BR /&gt;   on bGo pressed do&lt;BR /&gt;   &amp;amp;#40;&lt;BR /&gt;      messagebox "You chose \"test01\" - now try again"&lt;BR /&gt;   &amp;amp;#41;&lt;BR /&gt;&lt;BR /&gt;&amp;amp;#41;&lt;BR /&gt;createdialog dotNetProblem&lt;BR /&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks!</description>
      <pubDate>Sun, 18 Oct 2009 09:35:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/dotnet-and-messagebox-problems/m-p/4118715#M23320</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-18T09:35:55Z</dc:date>
    </item>
    <item>
      <title>Re: DotNet and messagebox problems</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/dotnet-and-messagebox-problems/m-p/4118716#M23321</link>
      <description>First add which Max version you use in your sig to can people help you without ask. &lt;BR /&gt;Don't worry, and I did not know this at the beginning :&amp;amp;#41;&lt;BR /&gt;I have no experience with dotNet but test your code in my 3dsmax 2009 x64 and the messagebox works, but after picking "wrong" object &amp;amp;#40;ie not "test01"&amp;amp;#41; - whole rollout controllers go out &amp;amp;#40;freezed&amp;amp;#41; and not accessible. In second pass test I just remove dotNet groupBox control and now works fine :&amp;amp;#41; I hope this helps a little bit.&lt;BR /&gt;&lt;PRE&gt;rollout dotNetProblem "dotNet Problem" width:278 height:170&lt;BR /&gt;&amp;amp;#40;&lt;BR /&gt; radiobuttons objectType labels:#&amp;amp;#40;"Mesh", "Spline"&amp;amp;#41; default:1 columns:2&lt;BR /&gt; label lObj "Picked: Mesh"&lt;BR /&gt; dotNetControl lblTitle "label"&lt;BR /&gt; pickButton bPick "Pick Object" pos: width:100 height:20&lt;BR /&gt; button bGo "Go" pos: width:120 height:30 enabled:false&lt;BR /&gt; &lt;BR /&gt; on dotNetProblem open do&lt;BR /&gt; &amp;amp;#40;&lt;BR /&gt; lblTitle.text = "dotNet Title"&lt;BR /&gt; bgcolor = &amp;amp;#40;colorman.getcolor #background&amp;amp;#41;*255&lt;BR /&gt; dnbgcolor = &amp;amp;#40;DotNetClass  "System.Drawing.Color"&amp;amp;#41;.FromArgb bgcolor bgcolor bgcolor&lt;BR /&gt; lblTitle.BackColor = dnbgcolor&lt;BR /&gt; dnFontStyle = dotNetClass "System.Drawing.FontStyle"&lt;BR /&gt; myFontStyle = dotnet.combineenums dnFontStyle.bold --dnFontStyle.italic&lt;BR /&gt; boldDNfont = dotNetObject "System.Drawing.Font" "MS Sans Serif" 8 myFontStyle&lt;BR /&gt; lblTitle.Font = boldDNfont&lt;BR /&gt; &amp;amp;#41;&lt;BR /&gt; &lt;BR /&gt; on objectType changed state do&lt;BR /&gt; &amp;amp;#40;&lt;BR /&gt; case state of &amp;amp;#40;&lt;BR /&gt; 1: lObj.text = "Picked: Mesh"&lt;BR /&gt; 2: lObj.text = "Picked: Spline"&lt;BR /&gt; &amp;amp;#41;&lt;BR /&gt; &amp;amp;#41;&lt;BR /&gt; &lt;BR /&gt; on bPick picked obj do&lt;BR /&gt; &amp;amp;#40;&lt;BR /&gt; if obj != undefined do&lt;BR /&gt; &amp;amp;#40;&lt;BR /&gt; if obj.name != "test01" then&lt;BR /&gt; &amp;amp;#40;&lt;BR /&gt; messagebox "Object is not \"test01\""&lt;BR /&gt; bGo.enabled = false&lt;BR /&gt; bPick.text = "Pick Object"&lt;BR /&gt; &amp;amp;#41; else &amp;amp;#40;&lt;BR /&gt; bGo.enabled = true&lt;BR /&gt; bPick.text = obj.name&lt;BR /&gt; &amp;amp;#41;&lt;BR /&gt; &amp;amp;#41;&lt;BR /&gt; &amp;amp;#41;&lt;BR /&gt; &lt;BR /&gt; on bGo pressed do&lt;BR /&gt; &amp;amp;#40;&lt;BR /&gt; messagebox "You chose \"test01\" - now try again"&lt;BR /&gt; &amp;amp;#41;&lt;BR /&gt;&amp;amp;#41;&lt;BR /&gt;createdialog dotNetProblem&lt;/PRE&gt;</description>
      <pubDate>Sun, 18 Oct 2009 21:24:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/dotnet-and-messagebox-problems/m-p/4118716#M23321</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-18T21:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: DotNet and messagebox problems</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/dotnet-and-messagebox-problems/m-p/4118717#M23322</link>
      <description>Sorry about that - I'm using Max 2008. I also am running Max 2010 - but only seldom use it because most of our clients have not upgraded yet - so - putting 2010 in my signature wouldn't have helped. I still should have mentioned that.&lt;BR /&gt;&lt;BR /&gt;As for the groupbox - yes - it seems that that's where part of the problem is - but the workaround doesn't explain the problem. What if I do want to use a groupbox with a dotNet formatting?&lt;BR /&gt;&lt;BR /&gt;I noticed that if the script starts with the groupbox enabled - I get the "freeze" behavior as well. However, if I try to re-disable it once a wrong object is picked - it doesn't seem to matter - I still cannot access the buttons.&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Mon, 19 Oct 2009 07:43:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/dotnet-and-messagebox-problems/m-p/4118717#M23322</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-19T07:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: DotNet and messagebox problems</title>
      <link>https://forums.autodesk.com/t5/3ds-max-programming-forum/dotnet-and-messagebox-problems/m-p/4118718#M23323</link>
      <description>My short playing around with dotNet draw a conclusion so &lt;BR /&gt;Max UI controllers and dotNet controllers are not compatible at all. &lt;BR /&gt;I've still not met anyone who can explain these problems.&lt;BR /&gt;&lt;BR /&gt;I see only 2 solutions at the moment - &lt;BR /&gt;1. Don't use dotNet where you can done without it assistance. &lt;BR /&gt;2. If you use dotNet then done all job without Max rollouts controllers, &lt;BR /&gt;ie use dotNet objects and controllers only, even dialog form if necessary.&lt;BR /&gt;&lt;BR /&gt;However, there is no guarantee that I'm right &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;</description>
      <pubDate>Tue, 20 Oct 2009 01:17:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/3ds-max-programming-forum/dotnet-and-messagebox-problems/m-p/4118718#M23323</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2009-10-20T01:17:18Z</dc:date>
    </item>
  </channel>
</rss>

