473,659 Members | 2,666 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to get Screen Object that the an application is run from?

If I run my application from the explorer on my 2nd monitor, the
screen object reported via Screen.FromCont rol(theForm).Bo unds is the
primary screen bounds not the screen that my application is really
started from. I guess I could capture the mouse position and use
Screen.FromPoin t().Bounds, but is that the best way to do this?

I do not have a parent form to use in this case, because it is the
first form created. Creating an invisible form just center the first
form via CenterScreen of parent seems really bad.
Nov 20 '05 #1
2 2165
CenterScreen actually works the way you said, it captures the mouse location
and calls the Screen.FromPoin t() to determine which screen the form should
be centered on.

--
HTH,
-- Tom Spink, Über Geek

Please respond to the newsgroup,
so all can benefit

"Maybe it's a game called 'Punish the User'"
"Schorschi" <Sc*******@DSLE xtreme.COM> wrote in message
news:21******** *************** ***@posting.goo gle.com...
If I run my application from the explorer on my 2nd monitor, the
screen object reported via Screen.FromCont rol(theForm).Bo unds is the
primary screen bounds not the screen that my application is really
started from. I guess I could capture the mouse position and use
Screen.FromPoin t().Bounds, but is that the best way to do this?

I do not have a parent form to use in this case, because it is the
first form created. Creating an invisible form just center the first
form via CenterScreen of parent seems really bad.

Nov 20 '05 #2
Works just fine. Thx for the details.

Schor-
Nov 20 '05 #3

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

Similar topics

0
7956
by: Hiroyuki Tanaka | last post by:
Hi, I am trying to develop an application for a touch screen using buttons for the numeric pad with Completion ComboBoxes. At the moment I am having a problem sending the button presses to my Completion ComboBox using sendkey.wait. From the keyboard (that will not exist for my final application) I can enter text into my Completion and the selection completes as expected.
9
2816
by: Rajat Tandon | last post by:
Hello there, I am relatively new to the newsgroups and C#. I have never been disappointed with the groups and always got the prompt replies to my queries.This is yet another strange issue, I am facing. Please please help me to solve this as soon as possible. So here we go ... I am not able to take the screen shot of the windows form based "Smart
1
3592
by: BillZondlo | last post by:
Can someone look at this and tell me why, when I call this from my main app, it displays fine (fades form in and out) but then before my main app displays, I see other dialog boxes flash monentarily on the screen and this delays the main app display? Here is the fade which I compile to a dll and call from my main app: using System; using System.Threading; using System.Timers;
0
3271
by: Jeffery Tyree | last post by:
I have a machine that will be used to demo some Excel spreadsheets at a convention. Because I did not author the spreadsheets and attendees will be allowed to play with the spreadsheets, I needed a way to periodically restore the original versions. In addition to the "always-on-top click this button to reset demo" application I wrote, I chose to use screen saver code to reset the demo after a period of inactivity in the event an attendee...
3
2295
by: Dennis | last post by:
Is there any way my application can be notified if the user changes the screen resolution while running the application (VB.Net 2003). Thanks. -- Dennis in Houston
7
2161
by: Swanand Mokashi | last post by:
Hi all -- I would like to create an application(call it Application "A") that I would like to mimic exactly as a form on a foreign system (Application "F"). Application "F" is on the web (so basically I can not control it). I will have a form exactly on Application "A" as that of Application "F". Application "A" will submit to the url of the application "F". I would like to do a screen scrape of the confirmation obtained after submitting...
3
5391
by: steve | last post by:
Hi All I have textboxes within a TableLayoutpanel and I want to be able to position an independant control adjacent to a selected textbox This independent control allows selection of text to insert into the textbox I am having trouble achieving this, see code below, the x position is too far to the right and the y position is close to the bottom of the textbox and I want it to be side by side.
4
7780
by: jonathandrott | last post by:
Hi, i'm kinda new to vb.net and i'm trying to make an on screen keyboard to use with a touch screen. how do i get it to print a letter on the screen when the button is pressed in the textbox that is selected? do i do it as a ascii character? i'm trying to get data from a user. there are a couple of different field the user will have to type information into. (i.e. first name, last name, .etc)
5
9007
Atran
by: Atran | last post by:
Hello Everyone. In this article: You will know to capture the screen in 2 ways: 1)- Capture full screen. 2)- Capture region. Let's Begin: First make a new Windows Application project. And make sure your program uses these namespaces: using System;
0
8427
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
8746
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8523
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
8626
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
5649
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
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4334
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
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.