473,322 Members | 1,522 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Check resolution & taskbar height

Hi,

I'm building an application in VB.NET that can only be started if the
available desktop space is sufficient. This means that when the user starts
the application it has to check 2 things:

1. Does the screen resolution comply to the minimum resolution?
2. What's the height of the taskbar?
Does anyone know how to do this?

--
Met vriendelijke groet / With regards / Saludos,
Moviat Automatisering
Maurice Mertens
mauricem@moviat_KillSpamWordForEMail.nl

tel: +31 162 470 534
fax: +31 162 470 502
Jul 21 '05 #1
2 19813
I would do this. Put a label on your form and test this

Dim screen as System.Windows.Forms.Screen =
System.Windows.Forms.Screen.PrimaryScreen.

Label1.Text = screen.WorkingArea.ToString

This will retrun the working area of the screen. You should be able to make
all you decisions off of this. If the task bar is viewable and a normal
height, this will take that into account. For example, if the screen is
1024x768 and the taskbar is at its normal settings, this line will return
1024x740. If the taskbar is hidden it will return 1024x768. If its strechedm
it will adjust and return the results I think you are looking for.

I hope this helps,

Jerel

"Maurice Mertens" wrote:
Hi,

I'm building an application in VB.NET that can only be started if the
available desktop space is sufficient. This means that when the user starts
the application it has to check 2 things:

1. Does the screen resolution comply to the minimum resolution?
2. What's the height of the taskbar?
Does anyone know how to do this?

--
Met vriendelijke groet / With regards / Saludos,
Moviat Automatisering
Maurice Mertens
mauricem@moviat_KillSpamWordForEMail.nl

tel: +31 162 470 534
fax: +31 162 470 502

Jul 21 '05 #2
Jerel,

thanks for the information.
I also found another way which also works fine (allmost the same):

Dim frmWorkingArea As New Form
Dim rctWorkingarea As New Rectangle

rctWorkingarea = Screen.PrimaryScreen.GetWorkingArea(frmWorkingArea )
frmWorkingArea.Close()

With rctWorkingArea.Width you will get the width, with
rctWorkingArea.Height you will get the height.

"=?Utf-8?B?SmVyZWw=?=" <Je***@discussions.microsoft.com> wrote in
news:CC**********************************@microsof t.com:
I would do this. Put a label on your form and test this

Dim screen as System.Windows.Forms.Screen =
System.Windows.Forms.Screen.PrimaryScreen.

Label1.Text = screen.WorkingArea.ToString

This will retrun the working area of the screen. You should be able to
make all you decisions off of this. If the task bar is viewable and a
normal height, this will take that into account. For example, if the
screen is 1024x768 and the taskbar is at its normal settings, this
line will return 1024x740. If the taskbar is hidden it will return
1024x768. If its strechedm it will adjust and return the results I
think you are looking for.
I hope this helps,

Jerel

"Maurice Mertens" wrote:
Hi,

I'm building an application in VB.NET that can only be started if the
available desktop space is sufficient. This means that when the user
starts the application it has to check 2 things:

1. Does the screen resolution comply to the minimum resolution?
2. What's the height of the taskbar?
Does anyone know how to do this?

--
Met vriendelijke groet / With regards / Saludos,
Moviat Automatisering
Maurice Mertens
mauricem@moviat_KillSpamWordForEMail.nl

tel: +31 162 470 534
fax: +31 162 470 502


--
Met vriendelijke groet / With regards / Saludos,
Moviat Automatisering
Maurice Mertens
mauricem@moviat_KillSpamWordForEMail.nl

tel: +31 162 470 534
fax: +31 162 470 502
Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Markus Mohr | last post by:
Hi, everyone, I have a special problem: For every monitor resolution in 200 pixel steps from 800 to 1600 pixels I have an image to be shown as centered background-image. Those images all...
2
by: Maurice Mertens | last post by:
Hi, I'm building an application in VB.NET that can only be started if the available desktop space is sufficient. This means that when the user starts the application it has to check 2 things: ...
2
by: hohrin | last post by:
Hopefully someone here will be able to point me in the right direction. In my C# application I have several forms which get a taskbar button when open. These buttons appear correctly with...
7
by: tim | last post by:
can someone tell me which function returns the screen resolution in java script?
5
by: Maxi | last post by:
I have a 30X16 cells table in my html page. Table height and width are set to 100%. I have set size of every cell inside the table to 24 pixel. When I open the html page in maximize state in...
7
by: JaimeM26 | last post by:
I have been able to determine the resolution on the users machine, but i am looking for a way to force the resolution to 1024 X 768 if it is not that already in VB.NET. Can someone please help me...
9
by: Steve Wright | last post by:
Hi I'm developing a webpage that needs to include a different stylesheet depending on the screen resolution. I know that I could read the resolution in javascript and then do some sort of...
9
by: kombu67 | last post by:
I'm reading a series of images from a MS SQL table and saving them to directory. These are staff ID pictures from our security card app. Once I've extracted the ID photo from the security app to...
8
by: Bjorn Sagbakken | last post by:
Can screen resolution be detected with server code (in Page_Load) ? I have tried this: public int Width = Convert.ToInt32(System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width); public...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.