Results 1 to 6 of 6

Thread: setting resolution

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2008
    Posts
    778

    setting resolution

    hello, I am new in here so my questions quite simple.
    Can somebody suggest me a code on how to set the resolution of the screen
    I need because I think i will add this to my print button and the users would not have to bother changing the resolution by themselfs.

    I want to:

    save the current resolution of the user
    save it on same variables
    then change the resolution to 1280 x 1024
    print the form (which is already sorted and works)
    then set the resolution back to the one it was before

    Thank you

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: setting resolution

    Welcome to the forums.

    Why do you need a resolution change to print a form?

    What programming language are you using (and please don't say VB - either VB6 or VB.NET if you are using VB - thanks)

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2008
    Posts
    778

    Re: setting resolution

    Well i am using Visual Basic.
    My program contains quite a big list and it must be printed, to print it i need to display all of it on the screen. so thats where the problem comes in. My printing code might be not perfect, but it works well if the form is displayed fully on the screen before printing. I can upload it for you to have a look at it if you want.

    So on some computers my program's forms displays stupidly big. Even if i set the resolution 1440x900. On some computers it fits on the screen with a 1280x1024 resolution, but not on my computer for some reason.
    please advice
    Thank you

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: setting resolution

    "Visual Basic" by itself is almost useless - that still leaves us with at least 4 options of which language you are using (Classic VB like VB6, VBA in an Office applications 'VB Editor', VBScript, and VB.Net), each of which has significantly different methods of doing things.

    In your profile, it says you have VB.Net 2008, which is what I presume are using here.

    I haven't done a lot of work with .Net, but from what I've seen it is very good at automatically resizing everything on your form - you just need to set properties on the controls (Anchor and something else). If you do that, and set your forms style to Maximized, it will always automatically fit on the screen.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Apr 2008
    Posts
    778

    Re: setting resolution

    Well i dont find any option called Anchor, still having the problem.
    I am quite confused whether i am using just VB or VB.net.
    Thats what is says on my computer-Microsoft Visual Basic 2005 Express Edition.

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: setting resolution

    VB 2002 and later are all VB.Net.

    I just had a quick play, and it seems that Anchor and Dock are what I was thinking of.

    To set them, click on a control in the form design, then go to the Properties window and select the options you want for them. If the Properties window is in "categorised" view, they will both be in the Layout section.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width