Solved

Changing the workingarea using VB

Posted on 2011-02-24
12
340 Views
Last Modified: 2012-05-11
Hi all,

I have a form named FormQueues and I am trying to having it dock to the right of the main window (usually referred to as Screen.PrimaryScreen.WorkingArea) so that no window can go on top of it and cover it. Like a taskbar if you want.

I am using Windows XP and Visual Basic 2005 but I can not get the workingarea to change. I have looked all over the net and nothing comes up that is helpful.

Can anybody help?
0
Comment
Question by:touyets17
  • 6
  • 3
12 Comments
 
LVL 30

Expert Comment

by:SiddharthRout
ID: 34978921
In vb6, we had the liberty of using the API SetWindowPos :)

For vb.Net, use the inbuilt property .Topmost to achieve what you want.

Me.TopMost = True

Now the problem is that the moment the app is full screen .Topmost fail for your window. So to overcome it place the above code inside a timer :)

Private Sub Timer1_Tick(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Timer1.Tick
    Me.TopMost = True
End Sub

Open in new window


Hope this helps.

Sid
0
 
LVL 30

Expert Comment

by:SiddharthRout
ID: 35147322
Could you please tell me why did you give a "C" to my suggestion?

Sid
0
 
LVL 30

Expert Comment

by:SiddharthRout
ID: 35147646
Thanks aiki

Sid
0
 
LVL 30

Expert Comment

by:SiddharthRout
ID: 35148350
Definitely :)

Sid
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:touyets17
ID: 35148845
Hi both, sorry, didn't mean to influence Sid's ranking. Sid's answer didn't answer my query totally. i needed to reserve the space on teh workspace and Sid's answer only permitted me to have the form on top of any other window but it hid whatever part of teh window that was right beneath it.

After a lot of research on teh net, i can not find anythinga nd I gave up on that aspect of the form. :( it happens.

thanks for helping Sid since you were the opnly one to.
0
 
LVL 30

Expert Comment

by:SiddharthRout
ID: 35148891
>>> Sid's answer only permitted me to have the form on top of any other window but it hid whatever part of teh window that was right beneath it.

touyets17: Thanks for getting back. Let's try it again.

Can you please explain what exactly do you want? Because when we move a form to the top, the window beneath it will get fully/partially hidden. :)

Sid
0
 

Author Comment

by:touyets17
ID: 35415292
Hi all, sorry, I was away on holidays for a few weeks there.

Let's say that I have a screen resolution of 800x600 and I want teh software to change that working area (not teh resolution) to 500x 600 so taht a part of teh screen is completely reserved for my applicationa nd the other programs think that the maximum tehy can open up to is 500x600 and therefore not overlap my application
0
 
LVL 30

Accepted Solution

by:
SiddharthRout earned 500 total points
ID: 35416293
Ah! I now understand :)

You want to achieve what WinSplit sort of does :)

I have never tried it but here is one tool which I have used in the past which also follows the same principle. It's like a taskbar/sidebar which reserves place for itself. The code is in vb6 but I am sure can be changed to vb.net.

See this link.

Is this what you wanted?

Sid
0
 

Author Closing Comment

by:touyets17
ID: 35688131
That second link was exactly what I wanted!!!! thanks!. that was a hell of a difficult one i find ...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now