my $Main = new Win32::GUI::Window ( -name => "Window", -title => "Test", -pos => [100, 100], -size => [400, 400], -onResize => \&resize, ) or die "new Window"; $Main->AddTextfield( -name => "Edit", -pos => [0, 0], -size => [100, 100], -multiline => 1, -vscroll => 1, -autovscroll => 1, -keepselection => 1 , -readonly => 1, ); $Main->AddTextfield( -name => "Edit2", -pos => [0, 0], -size => [100, 24], -autovscroll => 1, ); $Main->Show(); Win32::GUI::Dialog(); sub resize { my ($self) = @_; my ($width, $height) = ($self->GetClientRect())[2..3]; $self->Edit->Resize($width+1, $height-30) if exists $self->{Edit}; $self->Edit2->Resize($width, $width) if exists $self->{Edit2}; # Fehler! }