Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » Interface and Graphics

Post new topic   Reply to topic
Static Controls... Goto page Previous  1, 2
View previous topic :: View next topic  
Author Message
Gilad_r
Centurion


Joined: 03 Mar 2004
Posts: 156

PostPosted: Apr 11th, 2004 06:59 PM    Post subject: Reply with quote

i have an owner form and an owned form. i want the owned form to stick to the bottom-right corner of the owner form
a regular form doesn't have a move event (only resize) and that's what the subclassing is for...
but no matter what i did i couldn't get the windows to draw together when the owner form is moved.
i tried wm_move,wm_moving,wm_enter/exitsizemove with a loop but nothing works.
the owned form is like dragged after it's owner

hope this is better:)
_________________
"you should make amends with you" (Incubus)
Back to top
View user's profile Send private message
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Apr 11th, 2004 07:21 PM    Post subject: Reply with quote

How about using the SetParent API?
_________________
No one is completely useless. They can at least be an example of what to avoid.
Back to top
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Gilad_r
Centurion


Joined: 03 Mar 2004
Posts: 156

PostPosted: Apr 12th, 2004 02:10 AM    Post subject: Reply with quote

make it a child window? it wouldn't work since i need it to be just outside the bottom-right corner and if it's a child window it only draws itself in the borders of his parent, no?
you know Winamp right? (who doesnt...) i want something like the way the Playlist window is dragged with the Player window in Winamp.
_________________
"you should make amends with you" (Incubus)
Back to top
View user's profile Send private message
Gilad_r
Centurion


Joined: 03 Mar 2004
Posts: 156

PostPosted: Apr 12th, 2004 11:06 AM    Post subject: Reply with quote

your thoughts?
_________________
"you should make amends with you" (Incubus)
Back to top
View user's profile Send private message
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Apr 12th, 2004 03:07 PM    Post subject: Reply with quote

Something like this?
_________________
No one is completely useless. They can at least be an example of what to avoid.
Back to top
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Gilad_r
Centurion


Joined: 03 Mar 2004
Posts: 156

PostPosted: Apr 12th, 2004 04:05 PM    Post subject: Reply with quote

yup, just like that but without the little jumps...Wink

here's your code with a little change so you can really see the jumps:
_________________
"you should make amends with you" (Incubus)


Last edited by Gilad_r on Apr 12th, 2004 04:20 PM; edited 1 time in total
Back to top
View user's profile Send private message
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Apr 12th, 2004 04:17 PM    Post subject: Reply with quote

So that is what you wanted?
_________________
No one is completely useless. They can at least be an example of what to avoid.
Back to top
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Gilad_r
Centurion


Joined: 03 Mar 2004
Posts: 156

PostPosted: Apr 12th, 2004 04:25 PM    Post subject: Reply with quote

have a look at the attached code above.
_________________
"you should make amends with you" (Incubus)
Back to top
View user's profile Send private message
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Apr 12th, 2004 04:52 PM    Post subject: Reply with quote

I dunno... With the WM_MOVE message it's better than the WM_MOVING message but still not perfect if you move the window fast...

EDIT : The MoveWindow API makes it a bit better I think but not all that much...
_________________
No one is completely useless. They can at least be an example of what to avoid.
Back to top
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Gilad_r
Centurion


Joined: 03 Mar 2004
Posts: 156

PostPosted: Apr 14th, 2004 04:02 AM    Post subject: Reply with quote

ok, i'm still working on it but this method works best so far:
_________________
"you should make amends with you" (Incubus)
Back to top
View user's profile Send private message
shivdasn
Regular


Joined: 19 Jun 2005
Posts: 58
Location: India

PostPosted: Jun 20th, 2005 07:19 AM    Post subject: Re: Static Controls... Reply with quote

Tsudeki wrote:
Okay maybe they aren't static..but they certainly stay in the same spot(though they do move per se...anyway)...here's what I'm having problems with..

I want to keep a control in the upper right hand corner of my program and I want it to stay there when the form is resized. I've thought of using a picture box and aligning it to the right but that may cause problems with what I need it for though I'm not going to rule out the picture box, so..any suggestions are welcome ^^;

Thanks in advance..



Simple. On the Resize event type the following:

control1.top = 0 'will always stick to the top.
control1.left = form1.left+form1.width-control1.width

try this. It SHUD work (tho i havnt tried it. just applied logic.)

do tell me if it works (or not)
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » Interface and Graphics All times are GMT - 5 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic