<?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: Double click in list box to fire OK button in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/double-click-in-list-box-to-fire-ok-button/m-p/5441947#M41952</link>
    <description>&lt;P&gt;The fact that your DoubleClick event handler calls the OK button's handler method and the form/dialog box does not close as if OK button is clicked indicates that the OK button has its property "Dialogresult" being set either OK, or Cancel, which means closing/hiding the form where the button is hosted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to let the listbox's DoubleClick and the OK button's Click event handler share the same handling method, you need to set the button's DialogResult prperty to None, and then iin the handling method to call Form.DialogResilt=OK/Cancel.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Dec 2014 20:20:09 GMT</pubDate>
    <dc:creator>norman.yuan</dc:creator>
    <dc:date>2014-12-12T20:20:09Z</dc:date>
    <item>
      <title>Double click in list box to fire OK button</title>
      <link>https://forums.autodesk.com/t5/net-forum/double-click-in-list-box-to-fire-ok-button/m-p/5441837#M41951</link>
      <description>&lt;P&gt;I have a list box with text items in it. When I click on the OK button on the form it returns the string selected. I want to utilize the listbox DoubleClick event to fire the OK button. I've called the handler method for the OK button, but it just runs the code and the form stays open. I need it to act as if the user clicked the OK button. This method worked in vba. Any ideas how to do it in a C# windows form?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Dec 2014 18:58:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/double-click-in-list-box-to-fire-ok-button/m-p/5441837#M41951</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2014-12-12T18:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: Double click in list box to fire OK button</title>
      <link>https://forums.autodesk.com/t5/net-forum/double-click-in-list-box-to-fire-ok-button/m-p/5441947#M41952</link>
      <description>&lt;P&gt;The fact that your DoubleClick event handler calls the OK button's handler method and the form/dialog box does not close as if OK button is clicked indicates that the OK button has its property "Dialogresult" being set either OK, or Cancel, which means closing/hiding the form where the button is hosted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to let the listbox's DoubleClick and the OK button's Click event handler share the same handling method, you need to set the button's DialogResult prperty to None, and then iin the handling method to call Form.DialogResilt=OK/Cancel.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Dec 2014 20:20:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/double-click-in-list-box-to-fire-ok-button/m-p/5441947#M41952</guid>
      <dc:creator>norman.yuan</dc:creator>
      <dc:date>2014-12-12T20:20:09Z</dc:date>
    </item>
    <item>
      <title>Re: Double click in list box to fire OK button</title>
      <link>https://forums.autodesk.com/t5/net-forum/double-click-in-list-box-to-fire-ok-button/m-p/5442001#M41953</link>
      <description>&lt;P&gt;Thanks Norman, that was simple. I did a test and you don't need to set the button's DialogResult to None. It worked both ways. Seems like setting the property in the Click event just overrides what was previously set.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Dec 2014 21:14:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/double-click-in-list-box-to-fire-ok-button/m-p/5442001#M41953</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2014-12-12T21:14:09Z</dc:date>
    </item>
  </channel>
</rss>

