Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Automatic Scaling Container Control

Automatic Scaling Container Control

Scheduled Pinned Locked Moved Visual Basic
designdockerhelptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Cory Kimble
    wrote on last edited by
    #1

    I can't find any good examples of how to do this in CP or Google. I want to be able to auto scale my program no matter what PC resolution is set at. I think I can use the Auto Scaling. But I can't find any good examples. Maybe someone can look at the code and see if I even have it right.

    Dim ctrl As ContainerControl
    Dim dimens As SizeF
    Dim ratio As SizeF
    ctrl = New ContainerControl
    ctrl.AutoScaleMode = Windows.Forms.AutoScaleMode.Dpi

        dimens = ctrl.CurrentAutoScaleDimensions
        ratio = Me.AutoScaleFactor
    
        If dimens <> ratio Then
            ctrl.PerformAutoScale()
        End If
    

    I am trying to see if the design values are the same as the runtime and if not perform autoscale, but nothing happens. Can someone help, please. Thank you.

    J 1 Reply Last reply
    0
    • C Cory Kimble

      I can't find any good examples of how to do this in CP or Google. I want to be able to auto scale my program no matter what PC resolution is set at. I think I can use the Auto Scaling. But I can't find any good examples. Maybe someone can look at the code and see if I even have it right.

      Dim ctrl As ContainerControl
      Dim dimens As SizeF
      Dim ratio As SizeF
      ctrl = New ContainerControl
      ctrl.AutoScaleMode = Windows.Forms.AutoScaleMode.Dpi

          dimens = ctrl.CurrentAutoScaleDimensions
          ratio = Me.AutoScaleFactor
      
          If dimens <> ratio Then
              ctrl.PerformAutoScale()
          End If
      

      I am trying to see if the design values are the same as the runtime and if not perform autoscale, but nothing happens. Can someone help, please. Thank you.

      J Offline
      J Offline
      Jon Rista
      wrote on last edited by
      #2

      http://msdn.microsoft.com/en-us/library/ms229605.aspx

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups