Click here to Skip to main content
15,888,454 members
Home / Discussions / C#
   

C#

 
GeneralRe: http posting data and reading data post Pin
Eli Nurman17-Feb-08 15:10
Eli Nurman17-Feb-08 15:10 
GeneralRe: http posting data and reading data post Pin
Ravi Bhavnani17-Feb-08 15:50
professionalRavi Bhavnani17-Feb-08 15:50 
QuestionForm.Moving event - is it possible? Pin
DaveyM6917-Feb-08 1:24
professionalDaveyM6917-Feb-08 1:24 
AnswerRe: Form.Moving event - is it possible? Pin
Luc Pattyn17-Feb-08 2:16
sitebuilderLuc Pattyn17-Feb-08 2:16 
GeneralRe: Form.Moving event - is it possible? Pin
DaveyM6917-Feb-08 6:54
professionalDaveyM6917-Feb-08 6:54 
GeneralRe: Form.Moving event - is it possible? Pin
Luc Pattyn17-Feb-08 7:51
sitebuilderLuc Pattyn17-Feb-08 7:51 
GeneralRe: Form.Moving event - is it possible? Pin
DaveyM6917-Feb-08 10:34
professionalDaveyM6917-Feb-08 10:34 
GeneralRe: Form.Moving event - is it possible? [modified] Pin
DaveyM6917-Feb-08 11:09
professionalDaveyM6917-Feb-08 11:09 
This code works (where LeftLimit, TopLimit etc... are ints that equal the limits that the form is allowed to move to).
private const int WM_MOVING = 0x0216;

[StructLayout(LayoutKind.Sequential)]
struct RectangleStructure
{
    public int Left;
    public int Top;
    public int Right;
    public int Bottom;
}

protected override void WndProc(ref Message m)
{
    if (m.Msg == WM_MOVING)
    {
        RectangleStructure rectangle =
            (RectangleStructure)Marshal.PtrToStructure(m.LParam, typeof(RectangleStructure));
        if (rectangle.Left < LeftLimit)
        {
            rectangle.Right = LeftLimit + Width;
            rectangle.Left = LeftLimit;
            Marshal.StructureToPtr(rectangle, m.LParam, true);
        }
        if (rectangle.Top < TopLimit)
        {
            rectangle.Bottom = TopLimit + Height;
            rectangle.Top = TopLimit;
            Marshal.StructureToPtr(rectangle, m.LParam, true);
        }
        if (rectangle.Right > RightLimit)
        {
            rectangle.Left = RightLimit - Width;
            rectangle.Right = RightLimit;
            Marshal.StructureToPtr(rectangle, m.LParam, true);
        }
        if (rectangle.Bottom > BottomLimit)
        {
            rectangle.Top = BottomLimit - Height;
            rectangle.Bottom = BottomLimit;
            Marshal.StructureToPtr(rectangle, m.LParam, true);
        }
    }
    base.WndProc(ref m);


Dave

modified on Monday, February 18, 2008 1:49 PM

GeneralRe: Form.Moving event Pin
Luc Pattyn17-Feb-08 11:22
sitebuilderLuc Pattyn17-Feb-08 11:22 
GeneralRe: Form.Moving event Pin
DaveyM6919-Feb-08 11:41
professionalDaveyM6919-Feb-08 11:41 
GeneralRe: Form.Moving event Pin
Luc Pattyn19-Feb-08 13:32
sitebuilderLuc Pattyn19-Feb-08 13:32 
GeneralCodeDom Pin
danielk_16-Feb-08 23:54
danielk_16-Feb-08 23:54 
GeneralRe: CodeDom Pin
Gareth H17-Feb-08 0:37
Gareth H17-Feb-08 0:37 
GeneralRe: CodeDom Pin
Daniel Grunwald17-Feb-08 6:16
Daniel Grunwald17-Feb-08 6:16 
GeneralRe: CodeDom Pin
danielk_18-Feb-08 1:15
danielk_18-Feb-08 1:15 
GeneralSave & Retrieve Full HTML Pages (with images,styles,...) To Database. Pin
hdv21216-Feb-08 21:57
hdv21216-Feb-08 21:57 
GeneralRe: Save & Retrieve Full HTML Pages (with images,styles,...) To Database. Pin
Christian Graus16-Feb-08 23:09
protectorChristian Graus16-Feb-08 23:09 
GeneralRe: Save & Retrieve Full HTML Pages (with images,styles,...) To Database. Pin
hdv21217-Feb-08 1:05
hdv21217-Feb-08 1:05 
GeneralComplex rotation always has wrong answer. It looks bug is the visual Studio 8.0. Here is the code. Pin
AghaKhan16-Feb-08 20:55
AghaKhan16-Feb-08 20:55 
GeneralRe: Complex rotation always has wrong answer. It looks bug is the visual Studio 8.0. Here is the code. Pin
Christian Graus16-Feb-08 21:40
protectorChristian Graus16-Feb-08 21:40 
GeneralRe: Complex rotation always has wrong answer. It looks bug is the visual Studio 8.0. Here is the code. Pin
AghaKhan17-Feb-08 7:34
AghaKhan17-Feb-08 7:34 
QuestionHow to take snapshot of ListView control with icons and save it to file? Pin
Chesnokov Yuriy16-Feb-08 20:18
professionalChesnokov Yuriy16-Feb-08 20:18 
GeneralRe: How to take snapshot of ListView control with icons and save it to file? Pin
Christian Graus16-Feb-08 21:41
protectorChristian Graus16-Feb-08 21:41 
GeneralRe: How to take snapshot of ListView control with icons and save it to file? Pin
Ravenet16-Feb-08 21:53
Ravenet16-Feb-08 21:53 
GeneralRe: How to take snapshot of ListView control with icons and save it to file? Pin
Christian Graus16-Feb-08 23:16
protectorChristian Graus16-Feb-08 23:16 

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.