DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 11 of 11

Thread: Changing a user's screen resolution

  1. #1
    Tom Short Guest

    Changing a user's screen resolution


    Hi all!

    is there a way to change a user's screen resolution?

    I am developing a card game in vb, and if the user's screen is @ anything
    other than 800x600, my controls get messed up. I have tried to use control
    resizing, but the picbox will not change due to the card size ... hmmm anyways,
    is there a better way to do this?

    Thanx in advance

    Tom

  2. #2
    Mike D Sutton Guest

    Re: Changing a user's screen resolution

    > is there a way to change a user's screen resolution?
    >
    > I am developing a card game in vb, and if the user's screen is @ anything
    > other than 800x600, my controls get messed up. I have tried to use control
    > resizing, but the picbox will not change due to the card size ... hmmm

    anyways,
    > is there a better way to do this?


    I'd not be too happy if some application was resizing my screen every time
    it loaded up unless it's explicitly needed (e.g. Fullscreen DirectX/OpenGL
    type games which set the monitor res back when there done)
    I'm not sure what would be the problem though, if you just have your form a
    fixed size then it shouldn't matter what screen res the user is running at,
    it will always look the same. If your using a scaleable window then just
    add offsets to where you draw the cards etc. Rather than resizing all your
    controls why not just have a control bar that sits at the top of the window
    rather than having to manually scale every control. That way if you need to
    move all the controls you just move the picture box that there all sitting
    in, nice and easy.
    Hope this helps,

    Mike


    -- EDais --

    WWW: Http://Members.xoom.com/EDais/
    Work E-Mail: EDais@btinternet.com
    Other E-Mail: Frankle@btinternet.com



  3. #3
    Ray Mercer Guest

    Re: Changing a user's screen resolution

    Hi

    > > I am developing a card game in vb, and if the user's screen is @

    anything
    > > other than 800x600, my controls get messed up. I have tried to use

    control
    > > resizing, but the picbox will not change due to the card size ... hmmm

    > anyways,
    > > is there a better way to do this?


    [snip]

    > I'm not sure what would be the problem though, if you just have your form

    a
    > fixed size then it shouldn't matter what screen res the user is running

    at,
    > it will always look the same. If your using a scaleable window then just
    > add offsets to where you draw the cards etc. Rather than resizing all

    your
    > controls why not just have a control bar that sits at the top of the

    window
    > rather than having to manually scale every control. That way if you need

    to
    > move all the controls you just move the picture box that there all sitting
    > in, nice and easy.


    As Mike said in the part I snipped - most apps should *not* change the
    display settings. Especially if you are using it as a lazy workaround to
    adding resizing code. That said - it is sometimes difficult to predict all
    variables (user's screen font size, etc...) - which is why there is a
    market for resizing controls. And some full-screen games don't need or want
    the overhead of resizing code.

    The API to change the screen res is ChangeDisplaySettings
    there is a great example of using it by Joe LeVasseur at Randy Birch's site:
    http://www.mvps.org/vbnet/code/enums...playchange.htm

    HTH,
    Ray Mercer
    MS-MVP Visual Basic



  4. #4
    Tom Short Guest

    Re: Changing a user's screen resolution


    "Tom Short" <aeries71@hotmail.com> wrote:
    >
    >Hi all!
    >
    >is there a way to change a user's screen resolution?
    >
    >I am developing a card game in vb, and if the user's screen is @ anything
    >other than 800x600, my controls get messed up. I have tried to use control
    >resizing, but the picbox will not change due to the card size ... hmmm anyways,
    >is there a better way to do this?
    >
    >Thanx in advance
    >
    >Tom



  5. #5
    Tom Short Guest

    Re: Changing a user's screen resolution


    Mike and Ray,

    Thanks for the quick response and creative criticism, i appreciate it. I
    see the problem with resetting the res, but i am still in a bind.

    Even using resizing code, the image of the cards (i am using an ocx for this)
    does not resize. the picture box control does, but the actual image from
    the ocx does not, any ideas?

    I am still fairly new to vb, so any advice would be terrific.

    Thanks again,
    Tom

  6. #6
    Mike D Sutton Guest

    Re: Changing a user's screen resolution

    > Mike and Ray,
    >
    > Thanks for the quick response and creative criticism, i appreciate it. I
    > see the problem with resetting the res, but i am still in a bind.
    >
    > Even using resizing code, the image of the cards (i am using an ocx for

    this)
    > does not resize. the picture box control does, but the actual image from
    > the ocx does not, any ideas?
    >
    > I am still fairly new to vb, so any advice would be terrific.


    Then just make sure that the picture box is big enough for the cards
    If the user tries to scale the picture box too small for your needs then
    scale it back up again in Form_Resize()
    It can flicker though, the only way of avoiding that (That I know of) is to
    subclass the window which isn't an easy topic, and would most probably
    present you with far more of a headache than the slightly annoying flicker
    when you re-size.
    Hope this helps,

    Mike


    -- EDais --

    WWW: Http://Members.xoom.com/EDais/
    Work E-Mail: EDais@btinternet.com
    Other E-Mail: Frankle@btinternet.com



  7. #7
    Tom Short Guest

    Re: Changing a user's screen resolution


    Again, Thanks for the quick response.

    I must say that this is probably the best source of info on vb i have found
    to date. I am still relatively new to vb, and really new to newsgroups and
    so far this is the friendliest group i have found. I have read thru some
    of the other postings, and those of you who help out, well, you are the greatest!
    I have yet to see a single flame, even on topics that may seem simple to
    some people. To me, this shows a lot of class, and that the people here remember
    what it was like when they first started out writing code. I only hope that
    i'll be good enough with vb to be able to give the kind of assistance that
    you all are giving.

    Again, Thank you
    Tom Short

  8. #8
    Ray Mercer Guest

    Re: Changing a user's screen resolution


    Tom

    > to date. I am still relatively new to vb, and really new to newsgroups and
    > so far this is the friendliest group i have found. I have read thru some
    > of the other postings, and those of you who help out, well, you are the

    greatest!
    > I have yet to see a single flame, even on topics that may seem simple to


    We aim to please.
    Thanks for the encouragement.

    Ray Mercer
    MS-MVP Visual Basic




  9. #9
    Mike D Sutton Guest

    Re: Changing a user's screen resolution

    > Again, Thanks for the quick response.

    No problem

    > I must say that this is probably the best source of info on vb i have

    found
    > to date. I am still relatively new to vb, and really new to newsgroups and
    > so far this is the friendliest group i have found. I have read thru some
    > of the other postings, and those of you who help out, well, you are the

    greatest!
    > I have yet to see a single flame, even on topics that may seem simple to
    > some people. To me, this shows a lot of class, and that the people here

    remember
    > what it was like when they first started out writing code. I only hope

    that
    > i'll be good enough with vb to be able to give the kind of assistance that
    > you all are giving.


    And there's no reason you shouldn't, I learned a great deal of what I know
    now in terms of VB graphics programming through this and similar newsgroups.
    Thanks to the work of the MVP's (Jim Deutch and Ray Mercer to mention but
    two) and everyone else who does their bit which makes it so successful as a
    learning resource.
    Also if you find this newsgroup useful then you may also want to take a look
    at
    Microsoft.public.vb.winapi.graphics
    which is a similar group.

    Mike


    -- EDais --

    WWW: Http://Members.xoom.com/EDais/
    Work E-Mail: EDais@btinternet.com
    Other E-Mail: Frankle@btinternet.com



  10. #10
    Kristi Bryant Guest

    Re: Changing a user's screen resolution


    How about when you click on a command button that prints a form? How do you
    keep the form from maximizing? My program sends all needed info. to the
    second form, and by clicking a button you can print out the form. However,
    my users want to use special half-sheet dot matrix printer pages and the
    form that prints is too large for the half sheet. How do I resize when printing?
    I have changed the background to a white color, but this does not change
    the size so it continues to run over. My form is set for fixed single, but
    that doesn't seem to apply to the form print function.


    "Ray Mercer" <raymer@mvps.org> wrote:
    >Hi
    >
    >> > I am developing a card game in vb, and if the user's screen is @

    >anything
    >> > other than 800x600, my controls get messed up. I have tried to use

    >control
    >> > resizing, but the picbox will not change due to the card size ... hmmm

    >> anyways,
    >> > is there a better way to do this?

    >
    >[snip]
    >
    >> I'm not sure what would be the problem though, if you just have your form

    >a
    >> fixed size then it shouldn't matter what screen res the user is running

    >at,
    >> it will always look the same. If your using a scaleable window then just
    >> add offsets to where you draw the cards etc. Rather than resizing all

    >your
    >> controls why not just have a control bar that sits at the top of the

    >window
    >> rather than having to manually scale every control. That way if you need

    >to
    >> move all the controls you just move the picture box that there all sitting
    >> in, nice and easy.

    >
    >As Mike said in the part I snipped - most apps should *not* change the
    >display settings. Especially if you are using it as a lazy workaround to
    >adding resizing code. That said - it is sometimes difficult to predict

    all
    >variables (user's screen font size, etc...) - which is why there is a
    >market for resizing controls. And some full-screen games don't need or

    want
    >the overhead of resizing code.
    >
    >The API to change the screen res is ChangeDisplaySettings
    >there is a great example of using it by Joe LeVasseur at Randy Birch's site:
    >http://www.mvps.org/vbnet/code/enums...playchange.htm
    >
    >HTH,
    >Ray Mercer
    >MS-MVP Visual Basic
    >
    >



  11. #11
    Ray Mercer Guest

    Re: Changing a user's screen resolution


    "Kristi Bryant" <kbryant@trane.com> wrote in message
    news:3acb6bdf$1@news.devx.com...
    >
    > How about when you click on a command button that prints a form? How do

    you
    > keep the form from maximizing? My program sends all needed info. to the
    > second form, and by clicking a button you can print out the form.


    If you want someone to answer a specific question you are going to have to
    post some code. "clicking a button that prints a form" is a rather oblique
    statement.

    FWIW,
    Ray




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center