Click here to Skip to main content
15,892,005 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to Set DataGridView.Rows[0].Visible To False ? Pin
hdv21212-Nov-06 11:22
hdv21212-Nov-06 11:22 
GeneralRe: How to Set DataGridView.Rows[0].Visible To False ? Pin
Christian Graus12-Nov-06 12:06
protectorChristian Graus12-Nov-06 12:06 
GeneralRe: How to Set DataGridView.Rows[0].Visible To False ? Pin
hdv21212-Nov-06 12:23
hdv21212-Nov-06 12:23 
GeneralRe: How to Set DataGridView.Rows[0].Visible To False ? Pin
Christian Graus12-Nov-06 12:30
protectorChristian Graus12-Nov-06 12:30 
AnswerRe: How to Set DataGridView.Rows[0].Visible To False ? Pin
shopi3012-Nov-06 14:12
shopi3012-Nov-06 14:12 
QuestionMoving Other Windows Pin
Now_Loading12-Nov-06 7:42
Now_Loading12-Nov-06 7:42 
AnswerRe: Moving Other Windows Pin
Amar Chaudhary12-Nov-06 8:21
Amar Chaudhary12-Nov-06 8:21 
GeneralRe: Moving Other Windows Pin
shopi3012-Nov-06 13:49
shopi3012-Nov-06 13:49 
Hi Amar Chaudhary.

You can do it, using InteropServices.

Example:

First you need attach the follow namespace

using System.Runtime.InteropServices;

Second you need import the Microsoft Windows Runtime dll's for declare the extern methods.

[DllImportAttribute("user32.dll")]<br />
public static extern bool ReleaseCapture();<br />
<br />
[DllImportAttribute("user32.dll")]<br />
public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);


Third you need declare the follow constants and methods for invoke the functions

private const int WM_NCLBUTTONDOWN = 0xA1;<br />
private const int HTCAPTION = 0x2;<br />
<br />
private void MoveForm()<br />
{<br />
    ReleaseCapture();<br />
    SendMessage(this.Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0);<br />
}<br />
<br />
protected override void WndProc(ref Message m)<br />
{<br />
    base.WndProc(ref m);<br />
<br />
    int WM_NCHITTEST = 0x84;<br />
    if (m.Msg == WM_NCHITTEST)<br />
    {<br />
        int HTCLIENT = 1;<br />
        int HTCAPTION = 2;<br />
        if (m.Result.ToInt32() == HTCLIENT)<br />
        {<br />
            m.Result = (IntPtr)HTCAPTION;<br />
        }<br />
    }<br />
}


Finally you need call the function with any MouseDown event

private void button1_MouseDown(object sender, MouseEventArgs e)<br />
{<br />
    if (e.Button == MouseButtons.Left)<br />
    {<br />
        this.MoveForm();<br />
    }<br />
}


Remember that you can replace the "this.Handle" for you Window Handle that you want move.

I hope that this resolve your problem.



SINCERELY.
ANTHONY ACUÑA

PREFERED PHRASE:
SOMEBODY TELL ME WHY IS MORE REAL WHEN I DREAM THAT I AM WAKE?

GeneralRe: Moving Other Windows Pin
Now_Loading12-Nov-06 14:03
Now_Loading12-Nov-06 14:03 
GeneralRe: Moving Other Windows Pin
Amar Chaudhary12-Nov-06 15:15
Amar Chaudhary12-Nov-06 15:15 
GeneralRe: Moving Other Windows Pin
Now_Loading12-Nov-06 15:55
Now_Loading12-Nov-06 15:55 
GeneralRe: Moving Other Windows Pin
shopi3013-Nov-06 1:19
shopi3013-Nov-06 1:19 
QuestionHow can I do to do when I Click on controls, I have a Message with Control Name? Pin
ks79@bk.ru12-Nov-06 7:19
ks79@bk.ru12-Nov-06 7:19 
AnswerRe: How can I do to do when I Click on controls, I have a Message with Control Name? Pin
User 665812-Nov-06 7:31
User 665812-Nov-06 7:31 
GeneralRe: How can I do to do when I Click on controls, I have a Message with Control Name? Pin
ks79@bk.ru12-Nov-06 7:42
ks79@bk.ru12-Nov-06 7:42 
GeneralRe: How can I do to do when I Click on controls, I have a Message with Control Name? Pin
User 665812-Nov-06 7:50
User 665812-Nov-06 7:50 
GeneralRe: How can I do to do when I Click on controls, I have a Message with Control Name? Pin
ks79@bk.ru12-Nov-06 7:57
ks79@bk.ru12-Nov-06 7:57 
GeneralRe: How can I do to do when I Click on controls, I have a Message with Control Name? Pin
User 665812-Nov-06 8:10
User 665812-Nov-06 8:10 
GeneralRe: How can I do to do when I Click on controls, I have a Message with Control Name? Pin
ks79@bk.ru12-Nov-06 8:20
ks79@bk.ru12-Nov-06 8:20 
GeneralRe: How can I do to do when I Click on controls, I have a Message with Control Name? Pin
User 665812-Nov-06 8:27
User 665812-Nov-06 8:27 
Questionpopup menu in tree view. Pin
h@s@n12-Nov-06 6:11
h@s@n12-Nov-06 6:11 
AnswerRe: popup menu in tree view. Pin
shopi3012-Nov-06 14:21
shopi3012-Nov-06 14:21 
AnswerRe: popup menu in tree view. Pin
beatles169212-Nov-06 20:20
beatles169212-Nov-06 20:20 
QuestionC# - Removing form border problems Pin
Sanstrom12-Nov-06 5:25
Sanstrom12-Nov-06 5:25 
AnswerRe: C# - Removing form border problems Pin
shopi3012-Nov-06 14:24
shopi3012-Nov-06 14:24 

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.