Wrox Programmer Forums
|
VB.NET General VB.NET discussions for issues that don't fall into other VB.NET forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 24th, 2004, 08:56 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default Screen Size

Hello,

I need to put a little notification form in the bottom right corner. What is the easiest way to do that in a windows forms app? I contemplated settings the Location object's x and y properties to put it in the bottom-right corner. Is there an easier way? If not, how do I get the screen's total width and height in VB.NET?

Thanks,

Brian
__________________
Brian
 
Old June 24th, 2004, 09:24 AM
Authorized User
 
Join Date: Jan 2004
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Add javascript: screen.Height and screen.Width

Gives resolution...

 
Old June 24th, 2004, 10:00 AM
Authorized User
 
Join Date: Jun 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

:)

  Hi,

   use it ...
copy and paste Form1_Load event (dot net )

        Me.Left = Screen.PrimaryScreen.WorkingArea.Right - Me.Width
        Me.Top = Screen.PrimaryScreen.WorkingArea.Bottom - Me.Height


      Hope it will help you..

Stay Beautiful,

Abdul Salam
 
Old June 24th, 2004, 10:06 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Try this:
Code:
this.Width = 200;
this.Height = 100;
Rectangle screenSize = Screen.PrimaryScreen.WorkingArea;
this.Top = screenSize.Height - this.Height;
this.Left = screenSize.Width - this.Width;
I am sure there must be other ways as well, but this has worked for me in the past.

Cheers,

P.S. Did you write a few articles about TypeConverters?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Antistar by Massive Attack (Track 9 from the album: 100th Window) What's This?
 
Old June 24th, 2004, 10:08 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Ooops, looks like abdusalam beat me to it.....

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Orchids by Stone Sour (Track 2 from the album: Stone Sour) What's This?
 
Old June 24th, 2004, 10:16 AM
Authorized User
 
Join Date: Jun 2004
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What ? ;) Hummm Enjoy !


Stay Beautiful,

Abdul Salam
 
Old June 24th, 2004, 10:45 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Thanks, that solved it.

Imar Yes I wrote a few on http://www.dotnetjohn.com.

Brian
 
Old June 24th, 2004, 10:50 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I thought so.

I was working on an expandable property for a control, while writing an article about it, and came across one of your articles.

I forgot to add a TypeConverterAttribute on my expandable class (the Highlighter class in your example) which caused all kinds of problems with serialization and loading the properties in the class at run-time. Your article put me on the right track.

Thanks for writing it.

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: battle-axe by Deftones (Track 7 from the album: Deftones) What's This?
 
Old June 26th, 2004, 03:41 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Imar,

Thank you for reading it. Glad I could help. I must also say to that I like your site also, and I check back now and then.

Brian
 
Old June 26th, 2004, 07:27 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

It needs a little work, though. Especially design-wise... ;)

I just put up a short article about adding expandable properties. I realized it's very similar to yours when I was almost finished (and run into that TypeConverter issue which I solved with your article).

I also think I made a mistake in my article. I think I applied the TypeConverter attribute in the wrong location. In your example, you applied it to the entire class, like this:
Code:
<TypeConverter(GetType(HighlightingTypeConverter))> _
Public Class Highlighting
However, in my example, I have added it to the public property of the class that has the convertible object. I think in your example, that would turn out like this:
Code:
 <DefaultValue(“”), Category(“Appearance”), _
  TypeConverter(GetType(HighlightingTypeConverter)), _  
  PersistenceMode(PersistenceMode.InnerProperty), _
  DesignerSerializationVisibility (DesignerSerializationVisibility.Content)> _
  Public Property Highlighting As Highlighting
Obviously, by adding the attribute to the entire class, you get the behavior for free in all other locations with a HighLighting property, so it makes a lot more sense to apply it there.

But doesn't it "dirty up" the class? Are you aware of any side effects of applying this attribute? By applying it to the public property, you apply it right where it's needed: just so the designer knows how to deal with that specific property.

I am inclined to apply it to the entire class rather than to the public property, but I am not sure. Any ideas?

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Hello It's Me by Lou Reed & John Cale (Track 15 from the album: Songs For Drella) What's This?





Similar Threads
Thread Thread Starter Forum Replies Last Post
how can clear the screen the screen malli_kv2 BOOK: Beginning Java 2, JDK 5 Edition 4 January 17th, 2009 12:43 AM
Draw on the screen without clearing the screen pu132 Visual Basic 2005 Basics 0 August 25th, 2006 09:03 PM
Screen Size and Java Script srotondo Classic ASP Professional 5 December 20th, 2004 07:24 PM
Size of Screen cinest General .NET 2 October 8th, 2004 03:33 AM
changing text size on screen markhardiman Classic ASP Professional 4 August 31st, 2004 07:01 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.