Reputation: 43
I have my winform app displayed simultaneously on dual screens: one on my laptop, one on my tv (connected via cable). My app has a listview and a richtextbox. By default, the whole app displays on my laptop's screen, and it's ok. The problem is, how can I display only the richtextbox on my tv's screen , not the listview.
Upvotes: 2
Views: 231
Reputation: 54532
Something like this should work for you. It uses the Screen.AllScreens
collection, each index is one of your monitors. Check if the location of your application is on your TV and write the appropiate code to hide what you need to. You could put this in the LocationChanged event.
if(Screen.AllScreens[0].Bounds.Contains(this.Bounds)) // 0 is the primary monitor
{ // use the index that equates to your TV
// Hide your listbox here.
}
Upvotes: 2