﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » ComboBox.PreventDropDown - Control items are free with the TAB key.</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Mon, 27 Apr 2026 06:00:23 GMT</lastBuildDate><ttl>20</ttl><item><title>ComboBox.PreventDropDown - Control items are free with the TAB key.</title><link>http://forum.strataframe.net/FindPost32661.aspx</link><description>cbIdUnidade.PreventDropDown = true;&lt;br/&gt;&lt;br/&gt;&lt;div&gt;However, when the user navigates through the fields with the TAB key, the control items are free to choose with arrows up and down.</description><pubDate>Sun, 21 Sep 2014 09:51:16 GMT</pubDate><dc:creator>Rogerio Mauri</dc:creator></item><item><title>RE: ComboBox.PreventDropDown - Control items are free with the TAB key.</title><link>http://forum.strataframe.net/FindPost32694.aspx</link><description>&lt;strong style="font-family: Verdana, Tahoma, Arial; font-size: 13px; line-height: 21.3333339691162px; background-color: rgb(249, 250, 252);"&gt;This is the componente code&lt;/strong&gt;&lt;span style="font-family: Verdana, Tahoma, Arial; font-size: 13px; line-height: 21.3333339691162px; background-color: rgb(249, 250, 252);"&gt;:&lt;/span&gt;&lt;br style="font-family: Verdana, Tahoma, Arial; font-size: 13px; line-height: 21.3333339691162px; background-color: rgb(249, 250, 252);"&gt;&lt;br style="font-family: Verdana, Tahoma, Arial; font-size: 13px; line-height: 21.3333339691162px; background-color: rgb(249, 250, 252);"&gt;&lt;div style="font-family: Verdana, Tahoma, Arial; font-size: 13px; line-height: 21.3333339691162px; background-color: rgb(249, 250, 252);"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;''' &amp;lt;summary&amp;gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ''' Override to prevent logic from executing under certain circumstnaces&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ''' &amp;lt;/summary&amp;gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ''' &amp;lt;param name="m"&amp;gt;&amp;lt;/param&amp;gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; '-- Determine if the drop down should be prevented&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If _PreventDropDown Then&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; '-- WM_LBUTTONDOWN or WM_LBUTTONDBLCLK&amp;nbsp;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If m.Msg = &amp;amp;H201 OrElse m.Msg = &amp;amp;H203 Then Return&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MyBase.WndProc(m)&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End Sub&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&lt;strong&gt;My suggestion:&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;''' &amp;lt;summary&amp;gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ''' Override to prevent logic from executing under certain circumstnaces&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ''' &amp;lt;/summary&amp;gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ''' &amp;lt;param name="m"&amp;gt;&amp;lt;/param&amp;gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ''' &amp;lt;remarks&amp;gt;&amp;lt;/remarks&amp;gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; '-- Determine if the drop down should be prevented&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If _PreventDropDown Then&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; '-- WM_LBUTTONDOWN or WM_LBUTTONDBLCLK or&amp;nbsp;&lt;font color="#ff0000"&gt;WM_KEYDOWN&lt;/font&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; If m.Msg = &amp;amp;H201 OrElse m.Msg = &amp;amp;H203&amp;nbsp;&lt;font color="#ff0000"&gt;OrElse m.Msg = &amp;amp;H100&lt;/font&gt;&amp;nbsp;Then Return&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End If&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MyBase.WndProc(m)&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; End Sub&amp;nbsp;</description><pubDate>Sun, 21 Sep 2014 09:51:16 GMT</pubDate><dc:creator>Rogerio Mauri</dc:creator></item><item><title>RE: ComboBox.PreventDropDown - Control items are free with the TAB key.</title><link>http://forum.strataframe.net/FindPost32666.aspx</link><description>Not sure what might be going on there. Maybe I could try and reproduce it from my side, but for a start, I can tell you that I have lots of ComboBoxes which Enable properties are being set to False and it's been working just fine.&lt;br/&gt;&lt;br/&gt;Also, reading the posts you mentioned, I noticed that in the end you state that you couldn't reproduce it on a test project and that you would investigate more in details what could be happening. Since you didn't come back with more information, I bet Trent assumed you had found something on your code.</description><pubDate>Fri, 05 Sep 2014 16:00:04 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: ComboBox.PreventDropDown - Control items are free with the TAB key.</title><link>http://forum.strataframe.net/FindPost32665.aspx</link><description>&lt;div&gt;When we use this property there are other problems.&amp;nbsp;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&lt;a href="http://forum.strataframe.net/Topic21646.aspx?Keywords=ComboBox%20enabled"&gt;&lt;a href="http://forum.strataframe.net/Topic21646.aspx?Keywords=ComboBox%20enabled"&gt;http://forum.strataframe.net/Topic21646.aspx?Keywords=ComboBox%20enabled&lt;/a&gt;&lt;/a&gt;</description><pubDate>Fri, 05 Sep 2014 06:18:32 GMT</pubDate><dc:creator>Rogerio Mauri</dc:creator></item><item><title>RE: ComboBox.PreventDropDown - Control items are free with the TAB key.</title><link>http://forum.strataframe.net/FindPost32664.aspx</link><description>Would it work if you set its Enable property to False?</description><pubDate>Fri, 05 Sep 2014 05:19:05 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: ComboBox.PreventDropDown - Control items are free with the TAB key.</title><link>http://forum.strataframe.net/FindPost32663.aspx</link><description>Hi Ivan...&lt;br/&gt;&lt;br/&gt;&lt;div&gt;But in help documentation StrataFrame:&lt;br/&gt;&lt;br/&gt;&lt;div&gt;--------------&lt;br/&gt;&lt;br/&gt;&lt;div&gt;What's New In Version 1.6.5.&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&lt;strong&gt;PreventDropDown property on a combo box has been added [440]&lt;/strong&gt;&lt;br/&gt;&lt;br/&gt;&lt;div&gt;&lt;span style="font-style: italic;"&gt;A new property has been to the combo box that will prevent the end-user from dropping down the list. This can be a useful tool when access to the drop down may need to be restricted for a period of time (modifying a record, for example).&lt;/span&gt;&lt;div&gt;&lt;span style="font-style: italic;"&gt;&lt;br/&gt;&lt;/span&gt;&lt;div&gt;&lt;span style="font-style: italic;"&gt;--------------&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;&lt;div&gt;Do not allow the user to change the record. This is expected.&amp;nbsp;</description><pubDate>Thu, 04 Sep 2014 19:52:40 GMT</pubDate><dc:creator>Rogerio Mauri</dc:creator></item><item><title>RE: ComboBox.PreventDropDown - Control items are free with the TAB key.</title><link>http://forum.strataframe.net/FindPost32662.aspx</link><description>Hi Rogerio.&lt;br/&gt;&lt;div&gt;&lt;br/&gt;That seems to make sense to me, since the property is saying that it will prevent the combo from dropping down its list, but not that you won't be able to navigate through its items using the arrow keys.</description><pubDate>Thu, 04 Sep 2014 16:42:48 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item></channel></rss>