By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,946 Members | 720 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,946 IT Pros & Developers. It's quick & easy.

position right bottom corner

zybernau
P: 35
Hi everyone,

how to find the position of the right bottom corner of the screen
[llike popups in yahoo messenger]
[like google talk notifications, thunderbird mail notifications]

i need to design a form and make it display in the right bottom corner , this should work even in various resolution
800*600,1400*900,..


Environment:
.net frame work 2.0
visual studio 2005


Thanks,
Rajamohan.M
Sep 18 '07 #1
Share this Question
Share on Google+
3 Replies


QVeen72
Expert 100+
P: 1,445
Hi,

This is for VB6, convert it to ur version of VB:
Make Forms property :
StartupPosition = Manual

Write this code in FormLoad Event :

Expand|Select|Wrap|Line Numbers
  1.     Me.Left = (Screen.Width - Me.Width)
  2.     Me.Top = (Screen.Height - Me.Height)
  3.  
Just take care of the Window's Task Bar's height..

Regards
Veena
Sep 18 '07 #2

zybernau
P: 35
tHanks , Veena.

this works

screen.PrimaryScreen.WorkingArea.Width

screen.PrimaryScreen.WorkingArea.Height


but the when i increased the taskbar its is not updating the height value

is there any method to find the taskbar heights/ original work area in windows screen




??
Sep 18 '07 #3

QVeen72
Expert 100+
P: 1,445
Hi,

This is again a VB6 code :
There is no direct way to get the height/width of the Task Bor, U need to get the Work Area, and Minus it from the Total Screen Area using API's

Expand|Select|Wrap|Line Numbers
  1. 'Declare this on the top of the code window
  2.  Private Type RECT
  3.     Left As Long
  4.     Top As Long
  5.     Right As Long
  6.     Bottom As Long
  7. End Type
  8.  
  9. Private Type TBarData
  10.     cbSize As Long
  11.     hwnd As Long
  12.     uCallbackMessage As Long
  13.     uEdge As Long
  14.     rc As RECT
  15.     lParam As Long
  16. End Type
  17.  
  18. Private Declare Function SHAppBarMessage Lib "shell32.dll" (ByVal dwMessage As Long, pData As TBarData) As Long
  19.  
  20. ' write this on command click:
  21. Private Sub Command2_Click()
  22.     Dim TBar As TBarData
  23.     SHAppBarMessage &H5, TBar
  24.     MsgBox "WINDOWS TASK BAR STATS:" & vbCrLf & "Width:" & TBar.rc.Right - TBar.rc.Left & " Height:" & TBar.rc.Bottom - TBar.rc.Top
  25. End Sub
  26.  
  27.  

Regards
Veena
Sep 18 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.