| View previous topic :: View next topic |
| Author |
Message |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Sun Jul 13, 2008 11:21 am Post subject: Question about formBorderStyles... [any language] |
|
|
is it possible to download other borderstyles for my form or what i got in VS that's what i can use only...
_________________
Stylo |
|
| Back to top |
|
 |
Wintermoot Expert Cheater
Reputation: 0
Joined: 08 Nov 2007 Posts: 198
|
Posted: Thu Jul 17, 2008 1:16 am Post subject: |
|
|
| Do you really need anything else? You can add/remove all the buttons, you can add/remove the icon, you can add/remove the whole titlebar...
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Thu Jul 17, 2008 4:45 am Post subject: |
|
|
i tried doing that ..
removed title bar and added my own X button that exit the application
but i wanted to make a title bar that when i'll hold the left mouse button
i'll be able to move the form . . but i stucked with that
_________________
Stylo |
|
| Back to top |
|
 |
Renkokuken GO Moderator
Reputation: 4
Joined: 22 Oct 2006 Posts: 3249
|
Posted: Thu Jul 17, 2008 7:46 am Post subject: |
|
|
| 1qaz wrote: | i tried doing that ..
removed title bar and added my own X button that exit the application
but i wanted to make a title bar that when i'll hold the left mouse button
i'll be able to move the form . . but i stucked with that | That varies per language, which would you want a description of?
|
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Thu Jul 17, 2008 8:49 am Post subject: |
|
|
| Code: |
case WM_LBUTTONDOWN:
SendMessage(hWnd, WM_NCLBUTTONDOWN, HTCAPTION, NULL);
break;
|
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Thu Jul 17, 2008 9:12 am Post subject: |
|
|
Renkokuken i'm tring to do it on C#
and oib111 can u explain what's your code does ? what's this window message and what's the wParam contains ?
_________________
Stylo |
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Thu Jul 17, 2008 9:21 am Post subject: |
|
|
| Quote: |
The WM_NCLBUTTONDOWN message is posted when the user presses the left mouse button while the cursor is within the nonclient area of a window. This message is posted to the window that contains the cursor. If a window has captured the mouse, this message is not posted.
|
| Quote: |
Specifies the hit-test value returned by the DefWindowProc function as a result of processing the WM_NCHITTEST message. For a list of hit-test values, see WM_NCHITTEST.
|
| Quote: |
HTCAPTION In a title bar.
|
Basically you send a message that says that the user clicked in a non-client area of the window, and you say that he clicked on the title/caption bar. This allows the user to move the window. This happens whenever the user clicks with the left mouse button (controls are excluded from this though).
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
DeletedUser14087 I post too much
Reputation: 2
Joined: 21 Jun 2006 Posts: 3069
|
Posted: Thu Jul 17, 2008 9:21 am Post subject: |
|
|
| 1qaz wrote: | Renkokuken i'm tring to do it on C#
and oib111 can u explain what's your code does ? what's this window message and what's the wParam contains ? |
He's telling you to use Switch/Case on your Form.
the handle (HWND) is your form (Form.Handle i belive)
the other are messages to be sent, now, use switch (on a variable that is the condition) case the event and that's all.
Here's an example in Delphi.
| Code: | var i:boolean;
TButton1.Click();
Begin
case i of
True:SendMessage
False:Exit;
end;
end; |
Get 2 more buttons, 1 that sets i to true and 2 to set i to false, make them click button 1 as well ;].
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Thu Jul 17, 2008 9:31 am Post subject: |
|
|
but the thing is that i dont have a title / caption bar in my form
on FormBorderStyle's options i set "None" so all i can see is an empty form without nothing...
what i tried to do is to add a panel at the top of the form and then i used the MouseDown event (on the panel) when i want to move it . .
but i stuck at the form moving
my code was
| Code: |
private void panel1_MouseDown(object sender, EventArgs e)
{
this.location = Cursor.Location;
}
|
but as you can see it works but not as u expacted it's like the form's jumping to the mouse location :S
_________________
Stylo |
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Thu Jul 17, 2008 9:52 am Post subject: |
|
|
Just make it so that when the user clicks on the panel you send this message:
| Code: |
SendMessage(hWnd, WM_NCLBUTTONDOWN, HTCAPTION, NULL);
|
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Thu Jul 17, 2008 10:01 am Post subject: |
|
|
ok but HTCAPTION is undeclare variable how can i declare it at C# ?
is it handle to the title bar ? or in this case the panel?
_________________
Stylo |
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Thu Jul 17, 2008 10:24 am Post subject: |
|
|
HTCAPTION is a constant that says that the title/caption bar was clicked when you send the message WM_NCLBUTTONDOWN. Look it up on MSDN.
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
Stylo Grandmaster Cheater Supreme
Reputation: 3
Joined: 16 May 2007 Posts: 1073 Location: Israel
|
Posted: Thu Jul 17, 2008 10:50 am Post subject: |
|
|
nice i found it on msdn as u said, works perfect :] thx
_________________
Stylo |
|
| Back to top |
|
 |
oib111 I post too much
Reputation: 0
Joined: 02 Apr 2007 Posts: 2947 Location: you wanna know why?
|
Posted: Thu Jul 17, 2008 12:42 pm Post subject: |
|
|
Your welcome.
_________________
| 8D wrote: |
cigs dont make people high, which weed does, which causes them to do bad stuff. like killing |
|
|
| Back to top |
|
 |
|