Control FlexForm size?

Can I control the size of the flexform?
image

and, what means by

  • wpf_params ( kwargs ) – Additional WPF attributes
    what kind of parameters are they?

since the FlexFrom is a WPF Window, you could try adding Width=800 and Height=600 in the constructor of the form, like
form = FlexForm('Title', components, Width=800, Height=600)
I haven’t tried it but this should work.

1 Like

no it didn’t work :frowning: :frowning:

not my strong side here

the FlexForm is set to
SizeToContent="WidthAndHeight"
by default in the rpw implementation

I did not see an attribute implementation in there

you could use the WPFwindow implementation from pyrevit to get there and set in the xaml file that defines your window or directly un the python code defining the layout

Example adapted from the sample in the forms module of pyRevit:

from pyrevit import forms
layout = '<Window ' \
         'xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" ' \
         'xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" ' \
         'ShowInTaskbar="False" ResizeMode="NoResize" ' \
         'WindowStartupLocation="CenterScreen" ' \
         'Height="300"'\
         'Width="300"'\
         'HorizontalContentAlignment="Center">' \
         '</Window>'
w = forms.WPFWindow(layout, literal_string=True)
w.show()
1 Like