HwndSourceParameters.SetSize(Int32, Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the values that are used for the window size of the HwndSource.
public:
void SetSize(int width, int height);
public void SetSize (int width, int height);
member this.SetSize : int * int -> unit
Public Sub SetSize (width As Integer, height As Integer)
Parameters
- width
- Int32
The width of the window, in device pixels.
- height
- Int32
The height of the window, in device pixels.
Remarks
Unlike most methods that take rectangle screen-region measures in Windows Presentation Foundation (WPF), you specify this window size in device pixels, not in the typical device-independent units. If you need to size your window to its content, set SizeToContent to true
.
Do not pass 0 (zero) for either the width
or height
parameters. Although the method eventually succeeds even if you do pass 0, a substantial performance penalty occurs.
Applies to
See also
.NET