in reply to Re^2: Disable Control in Win32::GUI
in thread Disable Control in Win32::GUI
The confusing thing is your terminology. Your control is an textfield, and textfields don't do anything in response to single clicks, so setting an empty onClick handler isn't going to change it's behaviour.
If you said "I want to stop the user from being able to edit the text displayed in the Textfield", then it would be fairly obvious that you don't want to 'disable the control', you want to 'set the TextField readonly', which is a fairly common thing to want to do to edit fields and there is therefore an option for doing exactly that (called -readonly :). Try this
use strict; use Win32::GUI; use Win32::API; our $mainform = Win32::GUI::Window->new( -name=>'main', -text=>'main', ) or die "window creation failed: $!\n"; our $test = $mainform->AddTextfield( -name=>'test', -text=>'test', -left=>200,-top=>200, -width=>100,-height=>20, -readonly => 1, ) or die "control creation failed: $!\n"; $mainform->Show(); Win32::GUI::Dialog;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Disable Control in Win32::GUI
by ChrisR (Hermit) on Dec 20, 2005 at 00:57 UTC | |
by BrowserUk (Patriarch) on Dec 20, 2005 at 01:33 UTC | |
by ChrisR (Hermit) on Dec 20, 2005 at 02:42 UTC | |
by jplindstrom (Monsignor) on Dec 20, 2005 at 03:36 UTC | |
by ChrisR (Hermit) on Dec 20, 2005 at 19:08 UTC |