<?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: Palette set fixed size - disable resize possibility in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/palette-set-fixed-size-disable-resize-possibility/m-p/5935928#M37815</link>
    <description>&lt;P&gt;Sorry, playing with&amp;nbsp;Fixed values for sizes in de&amp;nbsp;WPF definitions&amp;nbsp;did not prevent the Panel to be resized. It prevent the UserControl to be resized but i think that's not enough&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 04 Dec 2015 11:05:52 GMT</pubDate>
    <dc:creator>SENL1362</dc:creator>
    <dc:date>2015-12-04T11:05:52Z</dc:date>
    <item>
      <title>Palette set fixed size - disable resize possibility</title>
      <link>https://forums.autodesk.com/t5/net-forum/palette-set-fixed-size-disable-resize-possibility/m-p/5928172#M37813</link>
      <description>&lt;P&gt;I've managed to get the palette set window to be fixed using this somewhat crude and brute force method:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;            Timer tDelayedResize = new Timer();
            tDelayedResize.Interval = 5;
            tDelayedResize.Tick += (s, e) =&amp;gt;
            {
                tDelayedResize.Stop();
                //Do your ResizeEnd logic here
                //...
                _ps1.Size = constSize;
            };

            _ps1.SizeChanged += (s, e) =&amp;gt;
            {
                tDelayedResize.Stop();
                tDelayedResize.Start();
            };


        }&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;however, I'm keen on finding a more slick way of achieving fixed palette size&lt;/P&gt;&lt;P&gt;After some soul searching, I came to realize I can hook to windows messages (MINMAXinfo, and similar)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for test purposes, I tried doing it on&amp;nbsp;a winform... but still dont have the hang of it.&lt;/P&gt;&lt;P&gt;my ultimate goal would be that "resize cursor" doesnt even appear when hovering over PS corner... but even a&amp;nbsp;constant size would be a treat at this point (my OCD just wont give me rest on this 1 :D)&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;PRE&gt;        private void button1_Click(object sender, EventArgs e)
        {
            if (hHook == 0)
            {
                // Create an instance of HookProc.
                HookProcedure = new HookProc(Form1.WinHookProc);

                hHook = SetWindowsHookEx(   //WH_CALLWNDPROCRET,
                                            WH_CALLWNDPROC,
                                            HookProcedure,
                                            (IntPtr)0,
                                            AppDomain.GetCurrentThreadId());
            }
        }

        public static int WinHookProc(int nCode, IntPtr wParam, IntPtr lParam)
        {
            //Marshall the data from the callback.
            //CWPretStruct MyHookStruct = (CWPretStruct)Marshal.PtrToStructure(lParam, typeof(CWPretStruct));
            CWPSTRUCT MyHookStruct = (CWPSTRUCT)Marshal.PtrToStructure(lParam, typeof(CWPSTRUCT));

            if (nCode &amp;lt; 0)
            {
                return CallNextHookEx(hHook, nCode, wParam, lParam);
            }
            else
            {
                MINMAXINFO mmi = (MINMAXINFO)Marshal.PtrToStructure(MyHookStruct.lparam, typeof(MINMAXINFO));
                
                mmi.ptMaxSize.x = 300;
                mmi.ptMaxSize.y = 300;
                System.Runtime.InteropServices.Marshal.StructureToPtr(mmi, MyHookStruct.lparam, true);

                return CallNextHookEx(hHook, nCode, wParam, lParam);
            }
        }

&lt;/PRE&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;P&gt;any tips on how to override such features would be graetly appreciated;&lt;BR /&gt;If any1 can offer a better solution than my PS code, or a tip when it comes to Hooks, I'd be more than grateful!&lt;/P&gt;</description>
      <pubDate>Sun, 29 Nov 2015 03:17:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/palette-set-fixed-size-disable-resize-possibility/m-p/5928172#M37813</guid>
      <dc:creator>5thSth</dc:creator>
      <dc:date>2015-11-29T03:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Palette set fixed size - disable resize possibility</title>
      <link>https://forums.autodesk.com/t5/net-forum/palette-set-fixed-size-disable-resize-possibility/m-p/5934390#M37814</link>
      <description>&lt;P&gt;bump/ cmon guys... any comment would be appreciated at this point &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;tell me to give up or something &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Dec 2015 13:14:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/palette-set-fixed-size-disable-resize-possibility/m-p/5934390#M37814</guid>
      <dc:creator>5thSth</dc:creator>
      <dc:date>2015-12-03T13:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: Palette set fixed size - disable resize possibility</title>
      <link>https://forums.autodesk.com/t5/net-forum/palette-set-fixed-size-disable-resize-possibility/m-p/5935928#M37815</link>
      <description>&lt;P&gt;Sorry, playing with&amp;nbsp;Fixed values for sizes in de&amp;nbsp;WPF definitions&amp;nbsp;did not prevent the Panel to be resized. It prevent the UserControl to be resized but i think that's not enough&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Dec 2015 11:05:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/palette-set-fixed-size-disable-resize-possibility/m-p/5935928#M37815</guid>
      <dc:creator>SENL1362</dc:creator>
      <dc:date>2015-12-04T11:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: Palette set fixed size - disable resize possibility</title>
      <link>https://forums.autodesk.com/t5/net-forum/palette-set-fixed-size-disable-resize-possibility/m-p/5945096#M37816</link>
      <description>&lt;P&gt;can you pls post the code for WPF definition override(if you've done it through hooks). maybe I learn something from it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2015 07:48:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/palette-set-fixed-size-disable-resize-possibility/m-p/5945096#M37816</guid>
      <dc:creator>5thSth</dc:creator>
      <dc:date>2015-12-10T07:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: Palette set fixed size - disable resize possibility</title>
      <link>https://forums.autodesk.com/t5/net-forum/palette-set-fixed-size-disable-resize-possibility/m-p/5945143#M37817</link>
      <description>&lt;P&gt;I doub't having code that benefits you because youre code already exceeded mine.&lt;/P&gt;&lt;P&gt;I "fixed" the sizes in the XAML to see what the behaviour would be for the Palette(set)-- so no hooks.&lt;/P&gt;&lt;P&gt;The result is that the UserControl stays fixed but the Palette keeps resizing, and it does not prevent the resize pointer to popup.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;UserControl x:Class="..FixedUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" Height="&lt;STRONG&gt;300&lt;/STRONG&gt;" Width="&lt;STRONG&gt;400&lt;/STRONG&gt;"  d:DesignHeight="300" d:DesignWidth="400"&amp;gt;
   
    &amp;lt;Grid Background="White" &amp;gt;
        &amp;lt;Grid.RowDefinitions&amp;gt;
            &amp;lt;RowDefinition Height="&lt;STRONG&gt;200&lt;/STRONG&gt;"/&amp;gt;
            &amp;lt;RowDefinition Height="&lt;STRONG&gt;50&lt;/STRONG&gt;" MinHeight="&lt;STRONG&gt;50&lt;/STRONG&gt;" MaxHeight="&lt;STRONG&gt;50&lt;/STRONG&gt;" /&amp;gt;
        &amp;lt;/Grid.RowDefinitions&amp;gt;
        &amp;lt;Grid.ColumnDefinitions&amp;gt;
            &amp;lt;ColumnDefinition Width="&lt;STRONG&gt;300&lt;/STRONG&gt;" /&amp;gt;
            &amp;lt;ColumnDefinition Width="&lt;STRONG&gt;100&lt;/STRONG&gt;" MinWidth="&lt;STRONG&gt;100&lt;/STRONG&gt;" MaxWidth="&lt;STRONG&gt;100&lt;/STRONG&gt;"/&amp;gt;
        &amp;lt;/Grid.ColumnDefinitions&amp;gt;

        &amp;lt;Grid  Grid.Row="0" Grid.Column="0"  &amp;gt;
            &amp;lt;TextBlock Name="tbkLayers"  Text="{Binding LayerText}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"  Margin="5" TextWrapping="Wrap" /&amp;gt;
        &amp;lt;/Grid&amp;gt;

        &amp;lt;Grid  Grid.Row="1" Grid.ColumnSpan="2" &amp;gt;
            &amp;lt;StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="5" &amp;gt;
                &amp;lt;Button  Name="btnOk" Content="OK"  MinWidth="150" MaxWidth="150"  Margin="5"  Click="btnOk_Click"/&amp;gt;
                &amp;lt;Button  Name="btnCancel" Content="Cancel"  MinWidth="150" MaxWidth="150"   Margin="5" IsCancel="True"   Click="btnCancel_Click"/&amp;gt;
            &amp;lt;/StackPanel&amp;gt;
        &amp;lt;/Grid&amp;gt;

    &amp;lt;/Grid&amp;gt;
&amp;lt;/UserControl&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Dec 2015 08:31:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/palette-set-fixed-size-disable-resize-possibility/m-p/5945143#M37817</guid>
      <dc:creator>SENL1362</dc:creator>
      <dc:date>2015-12-10T08:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Palette set fixed size - disable resize possibility</title>
      <link>https://forums.autodesk.com/t5/net-forum/palette-set-fixed-size-disable-resize-possibility/m-p/5947860#M37818</link>
      <description>&lt;P&gt;thanks for your reply. I'll try getting some more help&amp;nbsp;on c#,c++ forum if no1 else chips in.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;As for PS, its a shame that it doesnt have an "on event ended" event. I've tried a bunch of techniques, (derived classes, and&amp;nbsp;&lt;SPAN&gt;INotifyPropertyChanged, but&amp;nbsp;proved I wasnt skilled enough :()&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2015 16:53:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/palette-set-fixed-size-disable-resize-possibility/m-p/5947860#M37818</guid>
      <dc:creator>5thSth</dc:creator>
      <dc:date>2015-12-11T16:53:24Z</dc:date>
    </item>
  </channel>
</rss>

