Click here to Skip to main content
15,879,184 members
Home / Discussions / C#
   

C#

 
Generalhelp for run length encoding Pin
ali rezaiy28-May-09 8:56
ali rezaiy28-May-09 8:56 
GeneralRe: help for run length encoding Pin
harold aptroot28-May-09 10:59
harold aptroot28-May-09 10:59 
GeneralRe: help for run length encoding Pin
Alan Balkany28-May-09 11:06
Alan Balkany28-May-09 11:06 
QuestionWhat are your preferences for work with databases ADO.net 2.0 LINQ TO SQL or Entity Framework Pin
ToddHileHoffer28-May-09 7:45
ToddHileHoffer28-May-09 7:45 
AnswerRe: What are your preferences for work with databases ADO.net 2.0 LINQ TO SQL or Entity Framework Pin
PIEBALDconsult28-May-09 8:22
mvePIEBALDconsult28-May-09 8:22 
AnswerRe: What are your preferences for work with databases ADO.net 2.0 LINQ TO SQL or Entity Framework Pin
Henry Minute28-May-09 8:43
Henry Minute28-May-09 8:43 
GeneralRe: What are your preferences for work with databases ADO.net 2.0 LINQ TO SQL or Entity Framework Pin
ScottM128-May-09 20:21
ScottM128-May-09 20:21 
QuestionDraggable WinForm w/ Docked Control Problem Pin
baehoo28-May-09 7:42
baehoo28-May-09 7:42 
I have a windows form that can be moved around by clicking and dragging on any portion of the form. I used the method of overriding WndProc, and setting the result of the NCHITTEST function to be HTCAPTION, in order to fool the form into thinking I clicked the caption - so it enables dragging.

The code for this works great, and is below:


protected override void WndProc(ref Message msg)<br />
        {<br />
          if (msg.Msg == (int)WinAPI.NCHITTEST)<br />
                {<br />
                    DefWndProc(ref msg);<br />
                    if ((int)msg.Result == (int)MousePositionCodes.HTCLIENT)<br />
                    {<br />
                       msg.Result = (IntPtr)MousePositionCodes.HTCAPTION;<br />
                       return;<br />
                    }<br />
                }<br />
            }<br />
            base.WndProc(ref msg);<br />
        }



The problem occurs when I dock a ToolStripPanel into the form (this is acting as a draggable toolbar). I need any portion of the ToolStripPanel that is not covered by a ToolStrip to pass up the messages necessary to cause the whole form to enter drag mode.

I have created my own ToolStripContainer class to override the WndProc function and have tried using the same function as above, but it causes the ToolStripContainer to enter drag mode *within* the form, which is not the desired functionality.

I have also tried passing up NCHITTEST messages to the parent, as well as constructing a new message with the current mouse coordinates and sending it to the parent using the WinAPI and the parent's window handle.

I have to be missing something simple here... Anyone have any ideas? WTF | :WTF:
QuestionUsing sortedlist or sorteddictionary Pin
michaelgr128-May-09 7:10
michaelgr128-May-09 7:10 
AnswerRe: Using sortedlist or sorteddictionary Pin
Ennis Ray Lynch, Jr.28-May-09 7:23
Ennis Ray Lynch, Jr.28-May-09 7:23 
GeneralRe: Using sortedlist or sorteddictionary Pin
michaelgr128-May-09 7:24
michaelgr128-May-09 7:24 
GeneralRe: Using sortedlist or sorteddictionary Pin
Ennis Ray Lynch, Jr.28-May-09 7:29
Ennis Ray Lynch, Jr.28-May-09 7:29 
GeneralRe: Using sortedlist or sorteddictionary Pin
DaveyM6928-May-09 7:31
professionalDaveyM6928-May-09 7:31 
AnswerRe: Using sortedlist or sorteddictionary Pin
Luc Pattyn28-May-09 7:29
sitebuilderLuc Pattyn28-May-09 7:29 
GeneralRe: Using sortedlist or sorteddictionary Pin
michaelgr128-May-09 7:35
michaelgr128-May-09 7:35 
GeneralRe: Using sortedlist or sorteddictionary [modified] Pin
Luc Pattyn28-May-09 7:39
sitebuilderLuc Pattyn28-May-09 7:39 
AnswerRe: Using sortedlist or sorteddictionary Pin
dan!sh 28-May-09 7:30
professional dan!sh 28-May-09 7:30 
GeneralRe: Using sortedlist or sorteddictionary Pin
michaelgr128-May-09 7:42
michaelgr128-May-09 7:42 
GeneralRe: Using sortedlist or sorteddictionary Pin
michaelgr128-May-09 8:21
michaelgr128-May-09 8:21 
GeneralRe: Using sortedlist or sorteddictionary Pin
Henry Minute28-May-09 8:26
Henry Minute28-May-09 8:26 
GeneralRe: Using sortedlist or sorteddictionary Pin
michaelgr128-May-09 8:34
michaelgr128-May-09 8:34 
QuestionFile System C# Pin
sonya_rbi28-May-09 7:08
sonya_rbi28-May-09 7:08 
AnswerRe: File System C# Pin
DaveyM6928-May-09 7:28
professionalDaveyM6928-May-09 7:28 
AnswerRe: File System C# Pin
Luc Pattyn28-May-09 7:51
sitebuilderLuc Pattyn28-May-09 7:51 
QuestionAn elegant binding solution to getting the user to choose a COM port Pin
edwaugh28-May-09 7:02
edwaugh28-May-09 7:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.