Automatic Scaling Container Control
-
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.Dpidimens = 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.
-
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.Dpidimens = 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.