473,698 Members | 2,295 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 _KillSpamWordFo rEMail.nl

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

Dim screen as System.Windows. Forms.Screen =
System.Windows. Forms.Screen.Pr imaryScreen.

Label1.Text = screen.WorkingA rea.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 _KillSpamWordFo rEMail.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.PrimaryS creen.GetWorkin gArea(frmWorkin gArea)
frmWorkingArea. Close()

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

"=?Utf-8?B?SmVyZWw=?=" <Je***@discussi ons.microsoft.c om> wrote in
news:CC******** *************** ***********@mic rosoft.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.Pr imaryScreen.

Label1.Text = screen.WorkingA rea.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 _KillSpamWordFo rEMail.nl

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


--
Met vriendelijke groet / With regards / Saludos,
Moviat Automatisering
Maurice Mertens
mauricem@moviat _KillSpamWordFo rEMail.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
10472
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 have the same name and reside in the following physical path structure:
2
883
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: 1. Does the screen resolution comply to the minimum resolution? 2. What's the height of the taskbar?
2
3128
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 proper form name and application icon. however when the taskbar automatically groups the buttons together, the group button has no name, and the icon changes to the basic .exe icon. Is there a way to explicitly set the application group name and...
7
8102
by: tim | last post by:
can someone tell me which function returns the screen resolution in java script?
5
6201
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 either resolution 800 X 600 or 1152 X 864 it takes up the entire explorer size. In screen resolution 800 X 600, if I insert a pictures of 24 X 24 pixel in the cells it takes up the entire cell size (ideally it should as the cell size is also 24 X...
7
7626
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 with this. Also, is there a way to progromatically move the users taskbar back to the top or the bottom if it is located on either the left or right side of the screen? Thanks.
9
3901
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 stylesheet switcher as part of the onload event but I would rather link in the correct stylesheet for the resolution in the first place.
9
9632
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 disk, I need to reference the disk file in our HR app. As part of the process, I'm resizing the image and changing its resolution from 96 to 72 dpi. If they are not at a 72 dpi resolution, the HR app freezes. The resizing works without a hitch, but...
8
5361
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 int Height = Convert.ToInt32(System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Height); and sure enough, I get a couple of numbers; Width=1024 and Height=738 when running at 1024x768 - but I also get the same numbers when running at
0
8674
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8895
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7728
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.