<?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: ComboBox Problem on Tool Palette (ObjectARX managed API) in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/combobox-problem-on-tool-palette-objectarx-managed-api/m-p/1406095#M84101</link>
    <description>Use the following derivative instead of the standard&lt;BR /&gt;
.NET ComboBox control, and that should do it.&lt;BR /&gt;
&lt;BR /&gt;
public class AcadPaletteCombo : System.Windows.Forms.ComboBox&lt;BR /&gt;
{&lt;BR /&gt;
    protected override void WndProc( ref Message m )&lt;BR /&gt;
    {&lt;BR /&gt;
        if( m.Msg != 0x0167 )&lt;BR /&gt;
            base.WndProc( ref m );&lt;BR /&gt;
    }&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Norman Yuan" &lt;NOTREAL&gt; wrote in message news:4929045@discussion.autodesk.com...&lt;BR /&gt;
I am exploring ObjectARX managed API for a possible CAD application (ACAD&lt;BR /&gt;
MAP2006)&lt;BR /&gt;
&lt;BR /&gt;
I have built a small Windows form user conrol with a combo box. This user&lt;BR /&gt;
control is to be placed on Acad's tool palette. The problem occurs when the&lt;BR /&gt;
tool palette is docked: I cannot select item in the combobox' dropdown list&lt;BR /&gt;
(whther the dropdown style is set to DropDown or DropDownList, no&lt;BR /&gt;
difference). As soon as the mouse pointer leaves the "Dropdown Arrow", the&lt;BR /&gt;
dropdown list dispears, thus no selection can be made. However, if I drag&lt;BR /&gt;
the tool palette to floating, the combobox acts normally.&lt;BR /&gt;
&lt;BR /&gt;
Does anyone exeprience the same behaviour of tool palette, built in&lt;BR /&gt;
ObjectARX .NET API?&lt;BR /&gt;
&lt;BR /&gt;
Code snippet as following:&lt;BR /&gt;
&lt;BR /&gt;
public class MapSearchPalette&lt;BR /&gt;
{&lt;BR /&gt;
  static Autodesk.AutoCAD.Windows.Palette ps=null;&lt;BR /&gt;
&lt;BR /&gt;
  [Autodesk.AutoCAD.Runtime.CommandMethod("MapSearch")]&lt;BR /&gt;
  public static void ShowMapSearchPalette()&lt;BR /&gt;
  {&lt;BR /&gt;
   if (ps!=null) return;&lt;BR /&gt;
&lt;BR /&gt;
   //Create MapSearchControl&lt;BR /&gt;
   //which is in a seperate *.dll file with a few Windows User Controls&lt;BR /&gt;
defined&lt;BR /&gt;
   MapSearchControl ctrl=new MapSearchControl();&lt;BR /&gt;
&lt;BR /&gt;
   ps=new Autodesk.AutoCAD.Windows.PaletteSet("Map Search",&lt;BR /&gt;
    new Guid("63B8DB5B-10E4-4924-B8A2-A9CF9158E4F6"));&lt;BR /&gt;
   ps.Style = Autodesk.AutoCAD.Windows.PaletteSetStyles.NameEditable |&lt;BR /&gt;
    Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowPropertiesMenu |&lt;BR /&gt;
    Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowAutoHideButton |&lt;BR /&gt;
    Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowCloseButton |&lt;BR /&gt;
    Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowTabForSingle;&lt;BR /&gt;
   ps.MinimumSize = new System.Drawing.Size(400,250);&lt;BR /&gt;
   ps.Add("Map Search",ctrl);&lt;BR /&gt;
   ps.Visible=true;&lt;BR /&gt;
  }&lt;BR /&gt;
 }&lt;/NOTREAL&gt;</description>
    <pubDate>Wed, 17 Aug 2005 06:01:58 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2005-08-17T06:01:58Z</dc:date>
    <item>
      <title>ComboBox Problem on Tool Palette (ObjectARX managed API)</title>
      <link>https://forums.autodesk.com/t5/net-forum/combobox-problem-on-tool-palette-objectarx-managed-api/m-p/1406094#M84100</link>
      <description>I am exploring ObjectARX managed API for a possible CAD application (ACAD&lt;BR /&gt;
MAP2006)&lt;BR /&gt;
&lt;BR /&gt;
I have built a small Windows form user conrol with a combo box. This user&lt;BR /&gt;
control is to be placed on Acad's tool palette. The problem occurs when the&lt;BR /&gt;
tool palette is docked: I cannot select item in the combobox' dropdown list&lt;BR /&gt;
(whther the dropdown style is set to DropDown or DropDownList, no&lt;BR /&gt;
difference). As soon as the mouse pointer leaves the "Dropdown Arrow", the&lt;BR /&gt;
dropdown list dispears, thus no selection can be made. However, if I drag&lt;BR /&gt;
the tool palette to floating, the combobox acts normally.&lt;BR /&gt;
&lt;BR /&gt;
Does anyone exeprience the same behaviour of tool palette, built in&lt;BR /&gt;
ObjectARX .NET API?&lt;BR /&gt;
&lt;BR /&gt;
Code snippet as following:&lt;BR /&gt;
&lt;BR /&gt;
public class MapSearchPalette&lt;BR /&gt;
{&lt;BR /&gt;
  static Autodesk.AutoCAD.Windows.Palette ps=null;&lt;BR /&gt;
&lt;BR /&gt;
  [Autodesk.AutoCAD.Runtime.CommandMethod("MapSearch")]&lt;BR /&gt;
  public static void ShowMapSearchPalette()&lt;BR /&gt;
  {&lt;BR /&gt;
   if (ps!=null) return;&lt;BR /&gt;
&lt;BR /&gt;
   //Create MapSearchControl&lt;BR /&gt;
   //which is in a seperate *.dll file with a few Windows User Controls&lt;BR /&gt;
defined&lt;BR /&gt;
   MapSearchControl ctrl=new MapSearchControl();&lt;BR /&gt;
&lt;BR /&gt;
   ps=new Autodesk.AutoCAD.Windows.PaletteSet("Map Search",&lt;BR /&gt;
    new Guid("63B8DB5B-10E4-4924-B8A2-A9CF9158E4F6"));&lt;BR /&gt;
   ps.Style = Autodesk.AutoCAD.Windows.PaletteSetStyles.NameEditable |&lt;BR /&gt;
    Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowPropertiesMenu |&lt;BR /&gt;
    Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowAutoHideButton |&lt;BR /&gt;
    Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowCloseButton |&lt;BR /&gt;
    Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowTabForSingle;&lt;BR /&gt;
   ps.MinimumSize = new System.Drawing.Size(400,250);&lt;BR /&gt;
   ps.Add("Map Search",ctrl);&lt;BR /&gt;
   ps.Visible=true;&lt;BR /&gt;
  }&lt;BR /&gt;
 }</description>
      <pubDate>Mon, 15 Aug 2005 21:06:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/combobox-problem-on-tool-palette-objectarx-managed-api/m-p/1406094#M84100</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-08-15T21:06:02Z</dc:date>
    </item>
    <item>
      <title>Re: ComboBox Problem on Tool Palette (ObjectARX managed API)</title>
      <link>https://forums.autodesk.com/t5/net-forum/combobox-problem-on-tool-palette-objectarx-managed-api/m-p/1406095#M84101</link>
      <description>Use the following derivative instead of the standard&lt;BR /&gt;
.NET ComboBox control, and that should do it.&lt;BR /&gt;
&lt;BR /&gt;
public class AcadPaletteCombo : System.Windows.Forms.ComboBox&lt;BR /&gt;
{&lt;BR /&gt;
    protected override void WndProc( ref Message m )&lt;BR /&gt;
    {&lt;BR /&gt;
        if( m.Msg != 0x0167 )&lt;BR /&gt;
            base.WndProc( ref m );&lt;BR /&gt;
    }&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Norman Yuan" &lt;NOTREAL&gt; wrote in message news:4929045@discussion.autodesk.com...&lt;BR /&gt;
I am exploring ObjectARX managed API for a possible CAD application (ACAD&lt;BR /&gt;
MAP2006)&lt;BR /&gt;
&lt;BR /&gt;
I have built a small Windows form user conrol with a combo box. This user&lt;BR /&gt;
control is to be placed on Acad's tool palette. The problem occurs when the&lt;BR /&gt;
tool palette is docked: I cannot select item in the combobox' dropdown list&lt;BR /&gt;
(whther the dropdown style is set to DropDown or DropDownList, no&lt;BR /&gt;
difference). As soon as the mouse pointer leaves the "Dropdown Arrow", the&lt;BR /&gt;
dropdown list dispears, thus no selection can be made. However, if I drag&lt;BR /&gt;
the tool palette to floating, the combobox acts normally.&lt;BR /&gt;
&lt;BR /&gt;
Does anyone exeprience the same behaviour of tool palette, built in&lt;BR /&gt;
ObjectARX .NET API?&lt;BR /&gt;
&lt;BR /&gt;
Code snippet as following:&lt;BR /&gt;
&lt;BR /&gt;
public class MapSearchPalette&lt;BR /&gt;
{&lt;BR /&gt;
  static Autodesk.AutoCAD.Windows.Palette ps=null;&lt;BR /&gt;
&lt;BR /&gt;
  [Autodesk.AutoCAD.Runtime.CommandMethod("MapSearch")]&lt;BR /&gt;
  public static void ShowMapSearchPalette()&lt;BR /&gt;
  {&lt;BR /&gt;
   if (ps!=null) return;&lt;BR /&gt;
&lt;BR /&gt;
   //Create MapSearchControl&lt;BR /&gt;
   //which is in a seperate *.dll file with a few Windows User Controls&lt;BR /&gt;
defined&lt;BR /&gt;
   MapSearchControl ctrl=new MapSearchControl();&lt;BR /&gt;
&lt;BR /&gt;
   ps=new Autodesk.AutoCAD.Windows.PaletteSet("Map Search",&lt;BR /&gt;
    new Guid("63B8DB5B-10E4-4924-B8A2-A9CF9158E4F6"));&lt;BR /&gt;
   ps.Style = Autodesk.AutoCAD.Windows.PaletteSetStyles.NameEditable |&lt;BR /&gt;
    Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowPropertiesMenu |&lt;BR /&gt;
    Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowAutoHideButton |&lt;BR /&gt;
    Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowCloseButton |&lt;BR /&gt;
    Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowTabForSingle;&lt;BR /&gt;
   ps.MinimumSize = new System.Drawing.Size(400,250);&lt;BR /&gt;
   ps.Add("Map Search",ctrl);&lt;BR /&gt;
   ps.Visible=true;&lt;BR /&gt;
  }&lt;BR /&gt;
 }&lt;/NOTREAL&gt;</description>
      <pubDate>Wed, 17 Aug 2005 06:01:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/combobox-problem-on-tool-palette-objectarx-managed-api/m-p/1406095#M84101</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-08-17T06:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: ComboBox Problem on Tool Palette (ObjectARX managed API)</title>
      <link>https://forums.autodesk.com/t5/net-forum/combobox-problem-on-tool-palette-objectarx-managed-api/m-p/1406096#M84102</link>
      <description>Tony,&lt;BR /&gt;
&lt;BR /&gt;
Thanks for the code, but it is not working: the combobox behaves the same&lt;BR /&gt;
way.&lt;BR /&gt;
I did use the derived combo box in my UserControl (it works well in a Win&lt;BR /&gt;
Form test app, either with Windows.Forms.ComboBox or the derived ComboBox,&lt;BR /&gt;
BTW).&lt;BR /&gt;
&lt;BR /&gt;
Actually, my previous post was not very accurate: the Windows.Forms.ComboBox&lt;BR /&gt;
also behaves slightly abnormal on floating custom tool palette.&lt;BR /&gt;
&lt;BR /&gt;
The abnormality of ComboBox on tool palette is list below:&lt;BR /&gt;
&lt;BR /&gt;
1. When the custom palette is docked:&lt;BR /&gt;
&lt;BR /&gt;
Clicking on the combobox, dropdown list pops up. You can use arrow up/down&lt;BR /&gt;
key to select items in the list. As soon as you move mouse pointer into the&lt;BR /&gt;
dropdown list (to select item), the dropdown list disappears (so you cannot&lt;BR /&gt;
select with mouse). Also, When the dropdown list is shown, you can move the&lt;BR /&gt;
mouse pointer within the custom palette with the dropdown list still being&lt;BR /&gt;
shown, as soon as the mouse pointer moves to outside the custom palette, the&lt;BR /&gt;
dropdown list disappears (while Acad built-in combobox on its native&lt;BR /&gt;
palette/toolbar keeps its dropdown list shown no matter where the mouse&lt;BR /&gt;
pointer moves, until you click).&lt;BR /&gt;
&lt;BR /&gt;
2. When the custom palette is floating:&lt;BR /&gt;
&lt;BR /&gt;
If the custom palette has focus, the combobox works normally. However, if&lt;BR /&gt;
the custom palette does not have focus before you click the combobox, you&lt;BR /&gt;
need click it twice to get dropdown list shown (the first click gets the&lt;BR /&gt;
dropdown list shows and disappears in a flash, the effect is only to get the&lt;BR /&gt;
combobox focus). With Acad native palette (floating, having focus or not),&lt;BR /&gt;
single click on combobox pops up its dropdown list.&lt;BR /&gt;
&lt;BR /&gt;
So, I guess, this behaviour of Windows.Forms.ComboBox could be a buggy&lt;BR /&gt;
implement of managed API for the ObjectARX's tool palette. If so, where to&lt;BR /&gt;
report it? Might it be too late for Acad2006 SP1 to get it fixed?&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:4930564@discussion.autodesk.com...&lt;BR /&gt;
Use the following derivative instead of the standard&lt;BR /&gt;
.NET ComboBox control, and that should do it.&lt;BR /&gt;
&lt;BR /&gt;
public class AcadPaletteCombo : System.Windows.Forms.ComboBox&lt;BR /&gt;
{&lt;BR /&gt;
    protected override void WndProc( ref Message m )&lt;BR /&gt;
    {&lt;BR /&gt;
        if( m.Msg != 0x0167 )&lt;BR /&gt;
            base.WndProc( ref m );&lt;BR /&gt;
    }&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Norman Yuan" &lt;NOTREAL&gt; wrote in message&lt;BR /&gt;
news:4929045@discussion.autodesk.com...&lt;BR /&gt;
I am exploring ObjectARX managed API for a possible CAD application (ACAD&lt;BR /&gt;
MAP2006)&lt;BR /&gt;
&lt;BR /&gt;
I have built a small Windows form user conrol with a combo box. This user&lt;BR /&gt;
control is to be placed on Acad's tool palette. The problem occurs when the&lt;BR /&gt;
tool palette is docked: I cannot select item in the combobox' dropdown list&lt;BR /&gt;
(whther the dropdown style is set to DropDown or DropDownList, no&lt;BR /&gt;
difference). As soon as the mouse pointer leaves the "Dropdown Arrow", the&lt;BR /&gt;
dropdown list dispears, thus no selection can be made. However, if I drag&lt;BR /&gt;
the tool palette to floating, the combobox acts normally.&lt;BR /&gt;
&lt;BR /&gt;
Does anyone exeprience the same behaviour of tool palette, built in&lt;BR /&gt;
ObjectARX .NET API?&lt;BR /&gt;
&lt;BR /&gt;
Code snippet as following:&lt;BR /&gt;
&lt;BR /&gt;
public class MapSearchPalette&lt;BR /&gt;
{&lt;BR /&gt;
  static Autodesk.AutoCAD.Windows.Palette ps=null;&lt;BR /&gt;
&lt;BR /&gt;
  [Autodesk.AutoCAD.Runtime.CommandMethod("MapSearch")]&lt;BR /&gt;
  public static void ShowMapSearchPalette()&lt;BR /&gt;
  {&lt;BR /&gt;
   if (ps!=null) return;&lt;BR /&gt;
&lt;BR /&gt;
   //Create MapSearchControl&lt;BR /&gt;
   //which is in a seperate *.dll file with a few Windows User Controls&lt;BR /&gt;
defined&lt;BR /&gt;
   MapSearchControl ctrl=new MapSearchControl();&lt;BR /&gt;
&lt;BR /&gt;
   ps=new Autodesk.AutoCAD.Windows.PaletteSet("Map Search",&lt;BR /&gt;
    new Guid("63B8DB5B-10E4-4924-B8A2-A9CF9158E4F6"));&lt;BR /&gt;
   ps.Style = Autodesk.AutoCAD.Windows.PaletteSetStyles.NameEditable |&lt;BR /&gt;
    Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowPropertiesMenu |&lt;BR /&gt;
    Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowAutoHideButton |&lt;BR /&gt;
    Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowCloseButton |&lt;BR /&gt;
    Autodesk.AutoCAD.Windows.PaletteSetStyles.ShowTabForSingle;&lt;BR /&gt;
   ps.MinimumSize = new System.Drawing.Size(400,250);&lt;BR /&gt;
   ps.Add("Map Search",ctrl);&lt;BR /&gt;
   ps.Visible=true;&lt;BR /&gt;
  }&lt;BR /&gt;
 }&lt;/NOTREAL&gt;&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Wed, 17 Aug 2005 16:38:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/combobox-problem-on-tool-palette-objectarx-managed-api/m-p/1406096#M84102</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-08-17T16:38:38Z</dc:date>
    </item>
    <item>
      <title>Re: ComboBox Problem on Tool Palette (ObjectARX managed API)</title>
      <link>https://forums.autodesk.com/t5/net-forum/combobox-problem-on-tool-palette-objectarx-managed-api/m-p/1406097#M84103</link>
      <description>Autodesk is already aware of the issue and being this late in their year, I&lt;BR /&gt;
wouldn't expect to see it till Acad2007 is released. Throw the code below&lt;BR /&gt;
on your usercontrol [that represents the tool palette] and you shouldn't&lt;BR /&gt;
have any more issues. &lt;BR /&gt;
&lt;BR /&gt;
Regarding the code, there may be more here than is necessary and it is&lt;BR /&gt;
hacky, but it works and I  haven't had time to go through and optimize it.&lt;BR /&gt;
Beware of word wrap!&lt;BR /&gt;
&lt;BR /&gt;
Private Const GWL_EXSTYLE = (-20)&lt;BR /&gt;
Private Const WS_EX_CONTROLPARENT As Integer = 65536&lt;BR /&gt;
Private Const CBN_DROPDOWN As Integer = &amp;amp;H7&lt;BR /&gt;
Private Const CBN_CLOSEUP As Integer = &amp;amp;H8&lt;BR /&gt;
Private Const WM_COMMAND As Integer = &amp;amp;H111&lt;BR /&gt;
Private Const WM_MOUSEACTIVATE As Integer = &amp;amp;H21&lt;BR /&gt;
Private Const MA_ACTIVATE As Integer = &amp;amp;H1&lt;BR /&gt;
Private Const WinformReflectionBase As Integer = &amp;amp;H2000&lt;BR /&gt;
&lt;BR /&gt;
&lt;DLLIMPORT&gt; _&lt;BR /&gt;
Private Shared Function SetWindowLong(ByVal hWnd As IntPtr,  _&lt;BR /&gt;
  ByVal nIndex As Integer, ByVal dwNewLong As Integer) As Integer&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
&lt;DLLIMPORT&gt; _&lt;BR /&gt;
Private Shared Function GetWindowLong(ByVal hWnd As IntPtr, _&lt;BR /&gt;
  ByVal nIndex As Integer) As Integer&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
&lt;DLLIMPORT&gt; _&lt;BR /&gt;
Private Shared Function GetParent(ByVal hWnd As IntPtr) As IntPtr&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
#Region "UserControl Extras"&lt;BR /&gt;
&lt;BR /&gt;
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)&lt;BR /&gt;
  'check to see if control is activated&lt;BR /&gt;
  If m.Msg = 133 Then&lt;BR /&gt;
    'set the focus and populate the control is needed&lt;BR /&gt;
    Me.Focus()&lt;BR /&gt;
  ElseIf m.Msg = WinformReflectionBase + WM_COMMAND Then&lt;BR /&gt;
    Dim notifyCode As Integer = m.WParam.ToInt32()&lt;BR /&gt;
    notifyCode = notifyCode / &amp;amp;H10000&lt;BR /&gt;
    '''NOTE: ps is your global/local PaletteSet object&lt;BR /&gt;
    If notifyCode = CBN_DROPDOWN Then&lt;BR /&gt;
      ps.KeepFocus = True&lt;BR /&gt;
    ElseIf notifyCode = CBN_CLOSEUP Then&lt;BR /&gt;
      ps.KeepFocus = False&lt;BR /&gt;
    Else&lt;BR /&gt;
      'nothing for now&lt;BR /&gt;
    End If&lt;BR /&gt;
    'Watch out for the WM_MOUSEACTIVATE message and activate the control.&lt;BR /&gt;
  ElseIf m.Msg = WM_MOUSEACTIVATE Then&lt;BR /&gt;
    m.Result = New IntPtr(MA_ACTIVATE)&lt;BR /&gt;
    Return&lt;BR /&gt;
  End If&lt;BR /&gt;
  'make sure to continue with the normal flow of the message&lt;BR /&gt;
  MyBase.WndProc(m)&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Protected Overloads Overrides Sub OnLoad(ByVal e As EventArgs)&lt;BR /&gt;
  Dim hwndParent As IntPtr = GetParent(Me.Handle)&lt;BR /&gt;
  SetWindowLong(hwndParent, GWL_EXSTYLE, GetWindowLong(hwndParent, _&lt;BR /&gt;
  GWL_EXSTYLE) Or WS_EX_CONTROLPARENT)&lt;BR /&gt;
  MyBase.OnLoad(e)&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
#End Region&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- Mike&lt;BR /&gt;
___________________________&lt;BR /&gt;
Mike Tuersley&lt;BR /&gt;
___________________________&lt;BR /&gt;
the trick is to realize that there is no spoon...&lt;/DLLIMPORT&gt;&lt;/DLLIMPORT&gt;&lt;/DLLIMPORT&gt;</description>
      <pubDate>Wed, 17 Aug 2005 17:04:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/combobox-problem-on-tool-palette-objectarx-managed-api/m-p/1406097#M84103</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-08-17T17:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: ComboBox Problem on Tool Palette (ObjectARX managed API)</title>
      <link>https://forums.autodesk.com/t5/net-forum/combobox-problem-on-tool-palette-objectarx-managed-api/m-p/1406098#M84104</link>
      <description>Thank yo very much for the code. I'll give it a try later.&lt;BR /&gt;
&lt;BR /&gt;
"Mike Tuersley" &lt;MTUERSLEY_NOT_&gt; wrote in message&lt;BR /&gt;
news:4931205@discussion.autodesk.com...&lt;BR /&gt;
Autodesk is already aware of the issue and being this late in their year, I&lt;BR /&gt;
wouldn't expect to see it till Acad2007 is released. Throw the code below&lt;BR /&gt;
on your usercontrol [that represents the tool palette] and you shouldn't&lt;BR /&gt;
have any more issues.&lt;BR /&gt;
&lt;BR /&gt;
Regarding the code, there may be more here than is necessary and it is&lt;BR /&gt;
hacky, but it works and I  haven't had time to go through and optimize it.&lt;BR /&gt;
Beware of word wrap!&lt;BR /&gt;
&lt;BR /&gt;
Private Const GWL_EXSTYLE = (-20)&lt;BR /&gt;
Private Const WS_EX_CONTROLPARENT As Integer = 65536&lt;BR /&gt;
Private Const CBN_DROPDOWN As Integer = &amp;amp;H7&lt;BR /&gt;
Private Const CBN_CLOSEUP As Integer = &amp;amp;H8&lt;BR /&gt;
Private Const WM_COMMAND As Integer = &amp;amp;H111&lt;BR /&gt;
Private Const WM_MOUSEACTIVATE As Integer = &amp;amp;H21&lt;BR /&gt;
Private Const MA_ACTIVATE As Integer = &amp;amp;H1&lt;BR /&gt;
Private Const WinformReflectionBase As Integer = &amp;amp;H2000&lt;BR /&gt;
&lt;BR /&gt;
&lt;DLLIMPORT&gt; _&lt;BR /&gt;
Private Shared Function SetWindowLong(ByVal hWnd As IntPtr,  _&lt;BR /&gt;
  ByVal nIndex As Integer, ByVal dwNewLong As Integer) As Integer&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
&lt;DLLIMPORT&gt; _&lt;BR /&gt;
Private Shared Function GetWindowLong(ByVal hWnd As IntPtr, _&lt;BR /&gt;
  ByVal nIndex As Integer) As Integer&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
&lt;DLLIMPORT&gt; _&lt;BR /&gt;
Private Shared Function GetParent(ByVal hWnd As IntPtr) As IntPtr&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
#Region "UserControl Extras"&lt;BR /&gt;
&lt;BR /&gt;
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)&lt;BR /&gt;
  'check to see if control is activated&lt;BR /&gt;
  If m.Msg = 133 Then&lt;BR /&gt;
    'set the focus and populate the control is needed&lt;BR /&gt;
    Me.Focus()&lt;BR /&gt;
  ElseIf m.Msg = WinformReflectionBase + WM_COMMAND Then&lt;BR /&gt;
    Dim notifyCode As Integer = m.WParam.ToInt32()&lt;BR /&gt;
    notifyCode = notifyCode / &amp;amp;H10000&lt;BR /&gt;
    '''NOTE: ps is your global/local PaletteSet object&lt;BR /&gt;
    If notifyCode = CBN_DROPDOWN Then&lt;BR /&gt;
      ps.KeepFocus = True&lt;BR /&gt;
    ElseIf notifyCode = CBN_CLOSEUP Then&lt;BR /&gt;
      ps.KeepFocus = False&lt;BR /&gt;
    Else&lt;BR /&gt;
      'nothing for now&lt;BR /&gt;
    End If&lt;BR /&gt;
    'Watch out for the WM_MOUSEACTIVATE message and activate the control.&lt;BR /&gt;
  ElseIf m.Msg = WM_MOUSEACTIVATE Then&lt;BR /&gt;
    m.Result = New IntPtr(MA_ACTIVATE)&lt;BR /&gt;
    Return&lt;BR /&gt;
  End If&lt;BR /&gt;
  'make sure to continue with the normal flow of the message&lt;BR /&gt;
  MyBase.WndProc(m)&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Protected Overloads Overrides Sub OnLoad(ByVal e As EventArgs)&lt;BR /&gt;
  Dim hwndParent As IntPtr = GetParent(Me.Handle)&lt;BR /&gt;
  SetWindowLong(hwndParent, GWL_EXSTYLE, GetWindowLong(hwndParent, _&lt;BR /&gt;
  GWL_EXSTYLE) Or WS_EX_CONTROLPARENT)&lt;BR /&gt;
  MyBase.OnLoad(e)&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
#End Region&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- Mike&lt;BR /&gt;
___________________________&lt;BR /&gt;
Mike Tuersley&lt;BR /&gt;
___________________________&lt;BR /&gt;
the trick is to realize that there is no spoon...&lt;/DLLIMPORT&gt;&lt;/DLLIMPORT&gt;&lt;/DLLIMPORT&gt;&lt;/MTUERSLEY_NOT_&gt;</description>
      <pubDate>Wed, 17 Aug 2005 19:56:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/combobox-problem-on-tool-palette-objectarx-managed-api/m-p/1406098#M84104</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-08-17T19:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: ComboBox Problem on Tool Palette (ObjectARX managed API)</title>
      <link>https://forums.autodesk.com/t5/net-forum/combobox-problem-on-tool-palette-objectarx-managed-api/m-p/1406099#M84105</link>
      <description>Hi Mike - while as it turns out the problem is the KeepFocus&lt;BR /&gt;
property of the PaletteSet, I don't understand the 'fix'.&lt;BR /&gt;
&lt;BR /&gt;
What's wrong with just setting the PaletteSet's KeepFocus&lt;BR /&gt;
property to true ?&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Mike Tuersley" &lt;MTUERSLEY_NOT_&gt; wrote in message news:4931205@discussion.autodesk.com...&lt;BR /&gt;
Autodesk is already aware of the issue and being this late in their year, I&lt;BR /&gt;
wouldn't expect to see it till Acad2007 is released. Throw the code below&lt;BR /&gt;
on your usercontrol [that represents the tool palette] and you shouldn't&lt;BR /&gt;
have any more issues. &lt;BR /&gt;
&lt;BR /&gt;
Regarding the code, there may be more here than is necessary and it is&lt;BR /&gt;
hacky, but it works and I  haven't had time to go through and optimize it.&lt;BR /&gt;
Beware of word wrap!&lt;BR /&gt;
&lt;BR /&gt;
Private Const GWL_EXSTYLE = (-20)&lt;BR /&gt;
Private Const WS_EX_CONTROLPARENT As Integer = 65536&lt;BR /&gt;
Private Const CBN_DROPDOWN As Integer = &amp;amp;H7&lt;BR /&gt;
Private Const CBN_CLOSEUP As Integer = &amp;amp;H8&lt;BR /&gt;
Private Const WM_COMMAND As Integer = &amp;amp;H111&lt;BR /&gt;
Private Const WM_MOUSEACTIVATE As Integer = &amp;amp;H21&lt;BR /&gt;
Private Const MA_ACTIVATE As Integer = &amp;amp;H1&lt;BR /&gt;
Private Const WinformReflectionBase As Integer = &amp;amp;H2000&lt;BR /&gt;
&lt;BR /&gt;
&lt;DLLIMPORT&gt; _&lt;BR /&gt;
Private Shared Function SetWindowLong(ByVal hWnd As IntPtr,  _&lt;BR /&gt;
  ByVal nIndex As Integer, ByVal dwNewLong As Integer) As Integer&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
&lt;DLLIMPORT&gt; _&lt;BR /&gt;
Private Shared Function GetWindowLong(ByVal hWnd As IntPtr, _&lt;BR /&gt;
  ByVal nIndex As Integer) As Integer&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
&lt;DLLIMPORT&gt; _&lt;BR /&gt;
Private Shared Function GetParent(ByVal hWnd As IntPtr) As IntPtr&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
#Region "UserControl Extras"&lt;BR /&gt;
&lt;BR /&gt;
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)&lt;BR /&gt;
  'check to see if control is activated&lt;BR /&gt;
  If m.Msg = 133 Then&lt;BR /&gt;
    'set the focus and populate the control is needed&lt;BR /&gt;
    Me.Focus()&lt;BR /&gt;
  ElseIf m.Msg = WinformReflectionBase + WM_COMMAND Then&lt;BR /&gt;
    Dim notifyCode As Integer = m.WParam.ToInt32()&lt;BR /&gt;
    notifyCode = notifyCode / &amp;amp;H10000&lt;BR /&gt;
    '''NOTE: ps is your global/local PaletteSet object&lt;BR /&gt;
    If notifyCode = CBN_DROPDOWN Then&lt;BR /&gt;
      ps.KeepFocus = True&lt;BR /&gt;
    ElseIf notifyCode = CBN_CLOSEUP Then&lt;BR /&gt;
      ps.KeepFocus = False&lt;BR /&gt;
    Else&lt;BR /&gt;
      'nothing for now&lt;BR /&gt;
    End If&lt;BR /&gt;
    'Watch out for the WM_MOUSEACTIVATE message and activate the control.&lt;BR /&gt;
  ElseIf m.Msg = WM_MOUSEACTIVATE Then&lt;BR /&gt;
    m.Result = New IntPtr(MA_ACTIVATE)&lt;BR /&gt;
    Return&lt;BR /&gt;
  End If&lt;BR /&gt;
  'make sure to continue with the normal flow of the message&lt;BR /&gt;
  MyBase.WndProc(m)&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Protected Overloads Overrides Sub OnLoad(ByVal e As EventArgs)&lt;BR /&gt;
  Dim hwndParent As IntPtr = GetParent(Me.Handle)&lt;BR /&gt;
  SetWindowLong(hwndParent, GWL_EXSTYLE, GetWindowLong(hwndParent, _&lt;BR /&gt;
  GWL_EXSTYLE) Or WS_EX_CONTROLPARENT)&lt;BR /&gt;
  MyBase.OnLoad(e)&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
#End Region&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- Mike&lt;BR /&gt;
___________________________&lt;BR /&gt;
Mike Tuersley&lt;BR /&gt;
___________________________&lt;BR /&gt;
the trick is to realize that there is no spoon...&lt;/DLLIMPORT&gt;&lt;/DLLIMPORT&gt;&lt;/DLLIMPORT&gt;&lt;/MTUERSLEY_NOT_&gt;</description>
      <pubDate>Thu, 18 Aug 2005 01:05:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/combobox-problem-on-tool-palette-objectarx-managed-api/m-p/1406099#M84105</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-08-18T01:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: ComboBox Problem on Tool Palette (ObjectARX managed API)</title>
      <link>https://forums.autodesk.com/t5/net-forum/combobox-problem-on-tool-palette-objectarx-managed-api/m-p/1406100#M84106</link>
      <description>Norman - You should know that you can just as easily&lt;BR /&gt;
set the KeepFocus property of the PaletteSet to true,&lt;BR /&gt;
to avoid the problem. AutoCAD is stealing focus from&lt;BR /&gt;
the control, because it is seeing the dropdown control&lt;BR /&gt;
of the combobox as a popup, and it is sending out the&lt;BR /&gt;
WM_ACADKEEPFOCUS message to the PaletteSet, which&lt;BR /&gt;
reponds that it doesn't want to keep the focus (when&lt;BR /&gt;
the KeepFocus property is false).&lt;BR /&gt;
&lt;BR /&gt;
Just set KeepFocus to True, and that should solve one of &lt;BR /&gt;
the problems. I'm not familiar with the other problems&lt;BR /&gt;
Mike's code solves, but he's taking the 'VB6' approach to &lt;BR /&gt;
things, which is unnecessary in .NET.&lt;BR /&gt;
&lt;BR /&gt;
To change the window style, you just override the &lt;BR /&gt;
Control.CreateParams property, like this:&lt;BR /&gt;
&lt;BR /&gt;
protected override CreateParams CreateParams&lt;BR /&gt;
{&lt;BR /&gt;
    get&lt;BR /&gt;
    {&lt;BR /&gt;
        return base.CreateParams |= (int) WS_EX_CONTROLPARENT;&lt;BR /&gt;
    }&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Norman Yuan" &lt;NOTREAL&gt; wrote in message news:4931424@discussion.autodesk.com...&lt;BR /&gt;
Thank yo very much for the code. I'll give it a try later.&lt;BR /&gt;
&lt;BR /&gt;
"Mike Tuersley" &lt;MTUERSLEY_NOT_&gt; wrote in message&lt;BR /&gt;
news:4931205@discussion.autodesk.com...&lt;BR /&gt;
Autodesk is already aware of the issue and being this late in their year, I&lt;BR /&gt;
wouldn't expect to see it till Acad2007 is released. Throw the code below&lt;BR /&gt;
on your usercontrol [that represents the tool palette] and you shouldn't&lt;BR /&gt;
have any more issues.&lt;BR /&gt;
&lt;BR /&gt;
Regarding the code, there may be more here than is necessary and it is&lt;BR /&gt;
hacky, but it works and I  haven't had time to go through and optimize it.&lt;BR /&gt;
Beware of word wrap!&lt;BR /&gt;
&lt;BR /&gt;
Private Const GWL_EXSTYLE = (-20)&lt;BR /&gt;
Private Const WS_EX_CONTROLPARENT As Integer = 65536&lt;BR /&gt;
Private Const CBN_DROPDOWN As Integer = &amp;amp;H7&lt;BR /&gt;
Private Const CBN_CLOSEUP As Integer = &amp;amp;H8&lt;BR /&gt;
Private Const WM_COMMAND As Integer = &amp;amp;H111&lt;BR /&gt;
Private Const WM_MOUSEACTIVATE As Integer = &amp;amp;H21&lt;BR /&gt;
Private Const MA_ACTIVATE As Integer = &amp;amp;H1&lt;BR /&gt;
Private Const WinformReflectionBase As Integer = &amp;amp;H2000&lt;BR /&gt;
&lt;BR /&gt;
&lt;DLLIMPORT&gt; _&lt;BR /&gt;
Private Shared Function SetWindowLong(ByVal hWnd As IntPtr,  _&lt;BR /&gt;
  ByVal nIndex As Integer, ByVal dwNewLong As Integer) As Integer&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
&lt;DLLIMPORT&gt; _&lt;BR /&gt;
Private Shared Function GetWindowLong(ByVal hWnd As IntPtr, _&lt;BR /&gt;
  ByVal nIndex As Integer) As Integer&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
&lt;DLLIMPORT&gt; _&lt;BR /&gt;
Private Shared Function GetParent(ByVal hWnd As IntPtr) As IntPtr&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
#Region "UserControl Extras"&lt;BR /&gt;
&lt;BR /&gt;
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)&lt;BR /&gt;
  'check to see if control is activated&lt;BR /&gt;
  If m.Msg = 133 Then&lt;BR /&gt;
    'set the focus and populate the control is needed&lt;BR /&gt;
    Me.Focus()&lt;BR /&gt;
  ElseIf m.Msg = WinformReflectionBase + WM_COMMAND Then&lt;BR /&gt;
    Dim notifyCode As Integer = m.WParam.ToInt32()&lt;BR /&gt;
    notifyCode = notifyCode / &amp;amp;H10000&lt;BR /&gt;
    '''NOTE: ps is your global/local PaletteSet object&lt;BR /&gt;
    If notifyCode = CBN_DROPDOWN Then&lt;BR /&gt;
      ps.KeepFocus = True&lt;BR /&gt;
    ElseIf notifyCode = CBN_CLOSEUP Then&lt;BR /&gt;
      ps.KeepFocus = False&lt;BR /&gt;
    Else&lt;BR /&gt;
      'nothing for now&lt;BR /&gt;
    End If&lt;BR /&gt;
    'Watch out for the WM_MOUSEACTIVATE message and activate the control.&lt;BR /&gt;
  ElseIf m.Msg = WM_MOUSEACTIVATE Then&lt;BR /&gt;
    m.Result = New IntPtr(MA_ACTIVATE)&lt;BR /&gt;
    Return&lt;BR /&gt;
  End If&lt;BR /&gt;
  'make sure to continue with the normal flow of the message&lt;BR /&gt;
  MyBase.WndProc(m)&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Protected Overloads Overrides Sub OnLoad(ByVal e As EventArgs)&lt;BR /&gt;
  Dim hwndParent As IntPtr = GetParent(Me.Handle)&lt;BR /&gt;
  SetWindowLong(hwndParent, GWL_EXSTYLE, GetWindowLong(hwndParent, _&lt;BR /&gt;
  GWL_EXSTYLE) Or WS_EX_CONTROLPARENT)&lt;BR /&gt;
  MyBase.OnLoad(e)&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
#End Region&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- Mike&lt;BR /&gt;
___________________________&lt;BR /&gt;
Mike Tuersley&lt;BR /&gt;
___________________________&lt;BR /&gt;
the trick is to realize that there is no spoon...&lt;/DLLIMPORT&gt;&lt;/DLLIMPORT&gt;&lt;/DLLIMPORT&gt;&lt;/MTUERSLEY_NOT_&gt;&lt;/NOTREAL&gt;</description>
      <pubDate>Thu, 18 Aug 2005 01:20:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/combobox-problem-on-tool-palette-objectarx-managed-api/m-p/1406100#M84106</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-08-18T01:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: ComboBox Problem on Tool Palette (ObjectARX managed API)</title>
      <link>https://forums.autodesk.com/t5/net-forum/combobox-problem-on-tool-palette-objectarx-managed-api/m-p/1406101#M84107</link>
      <description>Hi Tony,&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; What's wrong with just setting the PaletteSet's KeepFocus&lt;BR /&gt;
&amp;gt; property to true ?&lt;BR /&gt;
&lt;BR /&gt;
Time??? As I said, I haven't had time to determine what's baggage/garbage&lt;BR /&gt;
vs. what actually fixes it. I've had lots of oddities occur with my palette&lt;BR /&gt;
project and the code I posted is a composite of various answers to combobox&lt;BR /&gt;
issues in 2006 and VS2003.&lt;BR /&gt;
&lt;BR /&gt;
I'll try the KeepFocus and see if it works - Thanks!&lt;BR /&gt;
&lt;BR /&gt;
-- Mike&lt;BR /&gt;
___________________________&lt;BR /&gt;
Mike Tuersley&lt;BR /&gt;
___________________________&lt;BR /&gt;
the trick is to realize that there is no spoon...</description>
      <pubDate>Thu, 18 Aug 2005 04:16:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/combobox-problem-on-tool-palette-objectarx-managed-api/m-p/1406101#M84107</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-08-18T04:16:17Z</dc:date>
    </item>
    <item>
      <title>Re: ComboBox Problem on Tool Palette (ObjectARX managed API)</title>
      <link>https://forums.autodesk.com/t5/net-forum/combobox-problem-on-tool-palette-objectarx-managed-api/m-p/1406102#M84108</link>
      <description>Hi Mike - With time, I'm sure you'll also realize that&lt;BR /&gt;
any Palette with controls on it that accept keyboard&lt;BR /&gt;
input (e.g., text boxes, editable combos, etc.), requires &lt;BR /&gt;
the PaletteSet's KeepFocus property to be true.&lt;BR /&gt;
&lt;BR /&gt;
If it is not, the user will be forced to keep the mouse&lt;BR /&gt;
cursor inside of the Pallet control when they enter text&lt;BR /&gt;
into its controls with the keyboard which of course, is &lt;BR /&gt;
something you would not wish on your worst enemy &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
The other issue, is that when you implement fixes like&lt;BR /&gt;
the ones you show, they should be in a base class that&lt;BR /&gt;
can be inherited from, so that any class derived from it&lt;BR /&gt;
will also inherit the functionality, without having to copy&lt;BR /&gt;
and paste all of that um... code into each control you&lt;BR /&gt;
build for hosting on a Palette.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Mike Tuersley" &lt;MTUERSLEY_NOT_&gt; wrote in message news:4931844@discussion.autodesk.com...&lt;BR /&gt;
Hi Tony,&lt;BR /&gt;
&lt;BR /&gt;
&amp;gt; What's wrong with just setting the PaletteSet's KeepFocus&lt;BR /&gt;
&amp;gt; property to true ?&lt;BR /&gt;
&lt;BR /&gt;
Time??? As I said, I haven't had time to determine what's baggage/garbage&lt;BR /&gt;
vs. what actually fixes it. I've had lots of oddities occur with my palette&lt;BR /&gt;
project and the code I posted is a composite of various answers to combobox&lt;BR /&gt;
issues in 2006 and VS2003.&lt;BR /&gt;
&lt;BR /&gt;
I'll try the KeepFocus and see if it works - Thanks!&lt;BR /&gt;
&lt;BR /&gt;
-- Mike&lt;BR /&gt;
___________________________&lt;BR /&gt;
Mike Tuersley&lt;BR /&gt;
___________________________&lt;BR /&gt;
the trick is to realize that there is no spoon...&lt;/MTUERSLEY_NOT_&gt;</description>
      <pubDate>Thu, 18 Aug 2005 12:50:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/combobox-problem-on-tool-palette-objectarx-managed-api/m-p/1406102#M84108</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-08-18T12:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: ComboBox Problem on Tool Palette (ObjectARX managed API)</title>
      <link>https://forums.autodesk.com/t5/net-forum/combobox-problem-on-tool-palette-objectarx-managed-api/m-p/1406103#M84109</link>
      <description>Thank you very much, Tony!&lt;BR /&gt;
&lt;BR /&gt;
I did not notice there is "KeepFocus" property. (I do not like the "Object&lt;BR /&gt;
Browser: in VS, it is buggy. I miss the way in VB/VBA to browse object).&lt;BR /&gt;
&lt;BR /&gt;
Basically, set "KeepFocus" to "true" solve the problem when tool palette is&lt;BR /&gt;
docked. However, when the tool palette is floating and the focus is not on&lt;BR /&gt;
the floating window, you still need two clicks to pull down combobox's list&lt;BR /&gt;
(the first click gets the list poping up and disappearing quickly). I can&lt;BR /&gt;
live with that and hope this will be fixed in future Acad release, so that I&lt;BR /&gt;
can avoid to roll out a derived combo box and make thing unnecessarily&lt;BR /&gt;
complicated.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again.&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message&lt;BR /&gt;
news:4931792@discussion.autodesk.com...&lt;BR /&gt;
Norman - You should know that you can just as easily&lt;BR /&gt;
set the KeepFocus property of the PaletteSet to true,&lt;BR /&gt;
to avoid the problem. AutoCAD is stealing focus from&lt;BR /&gt;
the control, because it is seeing the dropdown control&lt;BR /&gt;
of the combobox as a popup, and it is sending out the&lt;BR /&gt;
WM_ACADKEEPFOCUS message to the PaletteSet, which&lt;BR /&gt;
reponds that it doesn't want to keep the focus (when&lt;BR /&gt;
the KeepFocus property is false).&lt;BR /&gt;
&lt;BR /&gt;
Just set KeepFocus to True, and that should solve one of&lt;BR /&gt;
the problems. I'm not familiar with the other problems&lt;BR /&gt;
Mike's code solves, but he's taking the 'VB6' approach to&lt;BR /&gt;
things, which is unnecessary in .NET.&lt;BR /&gt;
&lt;BR /&gt;
To change the window style, you just override the&lt;BR /&gt;
Control.CreateParams property, like this:&lt;BR /&gt;
&lt;BR /&gt;
protected override CreateParams CreateParams&lt;BR /&gt;
{&lt;BR /&gt;
    get&lt;BR /&gt;
    {&lt;BR /&gt;
        return base.CreateParams |= (int) WS_EX_CONTROLPARENT;&lt;BR /&gt;
    }&lt;BR /&gt;
}&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Norman Yuan" &lt;NOTREAL&gt; wrote in message&lt;BR /&gt;
news:4931424@discussion.autodesk.com...&lt;BR /&gt;
Thank yo very much for the code. I'll give it a try later.&lt;BR /&gt;
&lt;BR /&gt;
"Mike Tuersley" &lt;MTUERSLEY_NOT_&gt; wrote in message&lt;BR /&gt;
news:4931205@discussion.autodesk.com...&lt;BR /&gt;
Autodesk is already aware of the issue and being this late in their year, I&lt;BR /&gt;
wouldn't expect to see it till Acad2007 is released. Throw the code below&lt;BR /&gt;
on your usercontrol [that represents the tool palette] and you shouldn't&lt;BR /&gt;
have any more issues.&lt;BR /&gt;
&lt;BR /&gt;
Regarding the code, there may be more here than is necessary and it is&lt;BR /&gt;
hacky, but it works and I  haven't had time to go through and optimize it.&lt;BR /&gt;
Beware of word wrap!&lt;BR /&gt;
&lt;BR /&gt;
Private Const GWL_EXSTYLE = (-20)&lt;BR /&gt;
Private Const WS_EX_CONTROLPARENT As Integer = 65536&lt;BR /&gt;
Private Const CBN_DROPDOWN As Integer = &amp;amp;H7&lt;BR /&gt;
Private Const CBN_CLOSEUP As Integer = &amp;amp;H8&lt;BR /&gt;
Private Const WM_COMMAND As Integer = &amp;amp;H111&lt;BR /&gt;
Private Const WM_MOUSEACTIVATE As Integer = &amp;amp;H21&lt;BR /&gt;
Private Const MA_ACTIVATE As Integer = &amp;amp;H1&lt;BR /&gt;
Private Const WinformReflectionBase As Integer = &amp;amp;H2000&lt;BR /&gt;
&lt;BR /&gt;
&lt;DLLIMPORT&gt; _&lt;BR /&gt;
Private Shared Function SetWindowLong(ByVal hWnd As IntPtr,  _&lt;BR /&gt;
  ByVal nIndex As Integer, ByVal dwNewLong As Integer) As Integer&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
&lt;DLLIMPORT&gt; _&lt;BR /&gt;
Private Shared Function GetWindowLong(ByVal hWnd As IntPtr, _&lt;BR /&gt;
  ByVal nIndex As Integer) As Integer&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
&lt;DLLIMPORT&gt; _&lt;BR /&gt;
Private Shared Function GetParent(ByVal hWnd As IntPtr) As IntPtr&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
#Region "UserControl Extras"&lt;BR /&gt;
&lt;BR /&gt;
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)&lt;BR /&gt;
  'check to see if control is activated&lt;BR /&gt;
  If m.Msg = 133 Then&lt;BR /&gt;
    'set the focus and populate the control is needed&lt;BR /&gt;
    Me.Focus()&lt;BR /&gt;
  ElseIf m.Msg = WinformReflectionBase + WM_COMMAND Then&lt;BR /&gt;
    Dim notifyCode As Integer = m.WParam.ToInt32()&lt;BR /&gt;
    notifyCode = notifyCode / &amp;amp;H10000&lt;BR /&gt;
    '''NOTE: ps is your global/local PaletteSet object&lt;BR /&gt;
    If notifyCode = CBN_DROPDOWN Then&lt;BR /&gt;
      ps.KeepFocus = True&lt;BR /&gt;
    ElseIf notifyCode = CBN_CLOSEUP Then&lt;BR /&gt;
      ps.KeepFocus = False&lt;BR /&gt;
    Else&lt;BR /&gt;
      'nothing for now&lt;BR /&gt;
    End If&lt;BR /&gt;
    'Watch out for the WM_MOUSEACTIVATE message and activate the control.&lt;BR /&gt;
  ElseIf m.Msg = WM_MOUSEACTIVATE Then&lt;BR /&gt;
    m.Result = New IntPtr(MA_ACTIVATE)&lt;BR /&gt;
    Return&lt;BR /&gt;
  End If&lt;BR /&gt;
  'make sure to continue with the normal flow of the message&lt;BR /&gt;
  MyBase.WndProc(m)&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
Protected Overloads Overrides Sub OnLoad(ByVal e As EventArgs)&lt;BR /&gt;
  Dim hwndParent As IntPtr = GetParent(Me.Handle)&lt;BR /&gt;
  SetWindowLong(hwndParent, GWL_EXSTYLE, GetWindowLong(hwndParent, _&lt;BR /&gt;
  GWL_EXSTYLE) Or WS_EX_CONTROLPARENT)&lt;BR /&gt;
  MyBase.OnLoad(e)&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
#End Region&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
-- Mike&lt;BR /&gt;
___________________________&lt;BR /&gt;
Mike Tuersley&lt;BR /&gt;
___________________________&lt;BR /&gt;
the trick is to realize that there is no spoon...&lt;/DLLIMPORT&gt;&lt;/DLLIMPORT&gt;&lt;/DLLIMPORT&gt;&lt;/MTUERSLEY_NOT_&gt;&lt;/NOTREAL&gt;&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Thu, 18 Aug 2005 15:36:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/combobox-problem-on-tool-palette-objectarx-managed-api/m-p/1406103#M84109</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-08-18T15:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: ComboBox Problem on Tool Palette (ObjectARX managed API)</title>
      <link>https://forums.autodesk.com/t5/net-forum/combobox-problem-on-tool-palette-objectarx-managed-api/m-p/1406104#M84110</link>
      <description>Good points to note, Tony, thanks!&lt;BR /&gt;
&lt;BR /&gt;
I wasn't concerned with keybard input because there is none - everything&lt;BR /&gt;
works off combos, up/dn numerics, next/prev buttons, etc. This is all per&lt;BR /&gt;
customer request which has been the cause of some inconsistancies but the&lt;BR /&gt;
biggest is the difference in communication [for lack of a better term] with&lt;BR /&gt;
the tool palette when it is in a docked vs floating state. &lt;BR /&gt;
&lt;BR /&gt;
-- Mike&lt;BR /&gt;
___________________________&lt;BR /&gt;
Mike Tuersley&lt;BR /&gt;
___________________________&lt;BR /&gt;
the trick is to realize that there is no spoon...</description>
      <pubDate>Thu, 18 Aug 2005 16:16:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/combobox-problem-on-tool-palette-objectarx-managed-api/m-p/1406104#M84110</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-08-18T16:16:33Z</dc:date>
    </item>
  </channel>
</rss>

