• 0

[VB6] Dockable Form


Question

Hey guys, I've a program that is supposed to take a toolwindow I have made and dock it to the edges of the screen when dragged to the edge. In general, it works great, but there is one bug I dont understand. When I run the application inside of VB (by hitting F5 to run), it works perfectly. After compiling though, whever I go to dock the form, it gets shoved back outside the area that was created for it on the screen. Calling my function again fixes the problem, but I shouldn't have to do that should I?

I have attached all files. Perhaps someone could take a look at them and tell me where I went wrong?

Additional Information: The program is designed to work on either the left or top edge. The form's shor side will be 510 and the long side will take up the length (or width) of the screen. The form can be dragged or the buttons on the orange form can be used. The buttom labeled "XXX" is a test button that can call my function for a second time, after being docked along the top edge (click the top edge of the button).

Thanks. Hope that made some sense. :rolleyes:

Form1.frm.txtFetching info...

Form2.frm.txtFetching info...

Module1.bas.txtFetching info...

Module2.bas.txtFetching info...

Link to comment
https://www.neowin.net/forum/topic/429297-vb6-dockable-form/
Share on other sites

12 answers to this question

Recommended Posts

  • 0

Ok, attached to this post is the entire project (source & compiled exe).

I've been working on it some more since my first post and it seems to half-working now. Sometimes I will start it up and the first time I dock it, it works, but subsequent docks turn my form into a dot and bounce it back and forth between the top & left edges. Let me know what kind of results you all get. Thanks! :)

DockExample.zipFetching info...

  • 0

i've got disappearing toolbar, and then i stopped and it had moved some desktop icons and didn't allow full screen maximization.

i'm definately keeping an eye on this as i need to dock my form to the edge of the screen at a user defined pixel level; but not replace the form or anything. I just want to go winamp style to the edge of the screen.

Did you do this within your code? If so, got any tips?

By the way, why are you using a timer? Seems kind of inefficient. I don't really have any recommendations, but there must be method that's called when the form is moved (or even using top and left somehow). As far as my program goes, it would literally be on the fly calculations done within mousedown, since I have no border (Google Groups). I was planning on literally finding screen size, storing to a variable, then subtracting and moving the form to be docked. The problem would be undocking. It may work if i set a variable for docked, then once it escapes the docking pixel range to set back to undocked. But this isn't like winamp, which magnetizes to the edge and can be moved while magnetized along the edge.

I can't find anything anywhere, so any input would help.

Thanks,

Matt

Edited by bigflavor
  • 0
  bigflavor said:
i've got disappearing toolbar, and then i stopped and it had moved some desktop icons and didn't allow full screen maximization.

i'm definately keeping an eye on this as i need to dock my form to the edge of the screen at a user defined pixel level; but not replace the form or anything. I just want to go winamp style to the edge of the screen.

Did you do this within your code? If so, got any tips?

By the way, why are you using a timer? Seems kind of inefficient. I don't really have any recommendations, but there must be method that's called when the form is moved (or even using top and left somehow). As far as my program goes, it would literally be on the fly calculations done within mousedown, since I have no border (Google Groups). I was planning on literally finding screen size, storing to a variable, then subtracting and moving the form to be docked. The problem would be undocking. It may work if i set a variable for docked, then once it escapes the docking pixel range to set back to undocked. But this isn't like winamp, which magnetizes to the edge and can be moved while magnetized along the edge.

I can't find anything anywhere, so any input would help.

Thanks,

Matt

What do you mean by "didn't allow full screen maximization"? :huh:

If you seek "docking" (or snaping to the edges of the screen), like Winamp does, Googling for "visual basic" and "dock form to edge of screen" should yield what you seek. :yes:

Do you all know of a way to work w/ other docked toolbars? Right now, my bar will hide behind my taskbar rather than go next to it... :unsure:

  • 0
  HopkinsProgramming said:

What do you mean by "didn't allow full screen maximization"? :huh:

If you seek "docking" (or snaping to the edges of the screen), like Winamp does, Googling for "visual basic" and "dock form to edge of screen" should yield what you seek. :yes:

Do you all know of a way to work w/ other docked toolbars? Right now, my bar will hide behind my taskbar rather than go next to it... :unsure:

1) after I stopped the app, whenever I attempted to maximize any windows, those windows would not take up the entire screen. They would fail to take up the space reserved for the dock. It happened to be after docking on the left side. Create an end program function and blah blah blah.

2) I had tried that, of course, and it didn't yeild any results. but I was lucky enough to get a response from an MVP on google groups. This may help you as well.

3) AH HAH! Within the class that Chris linked to, on his web site, you will see a hWnd call that finds the "work area," which excludes the taskbar.

That class did what I needed. Hope it helps you as well! Remember to post when you're finished.

Good luck!

Matt

Edited by bigflavor
  • 0
  bigflavor said:

1) after I stopped the app, whenever I attempted to maximize any windows, those windows would not take up the entire screen. They would fail to take up the space reserved for the dock. It happened to be after docking on the left side. Create an end program function and blah blah blah.

2) I had tried that, of course, and it didn't yeild any results. but I was lucky enough to get a response from an MVP on google groups. This may help you as well.

3) AH HAH! Within the class that Chris linked to, on his web site, you will see a hWnd call that finds the "work area," which excludes the taskbar.

That class did what I needed. Hope it helps you as well! Remember to post when you're finished.

Good luck!

Matt

1) Did you undock the bar and click exit? That will defintely free up the space.

2/3) COOL!!! Being able to get the area w/o the taskbar will be very useful! :laugh:

Thanks a bundle! :yes:

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.