CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Win32 Programming Help:
Reseting textfield text

 



samir_gambler
New User

May 3, 2013, 4:32 AM

Post #1 of 2 (10710 views)
Reseting textfield text Can't Post

Hello,

I am new to Perl GUI. I am trying to make a window with option to enter login ID and Password. I want to add a button to reset the textfield entry. I am unable to reset the text box entry. please have a look into the code


Code
use warnings; 
use Win32::GUI();

my $MainWindow = Win32::GUI::Window->new(
-text => 'Main',
-name => 'MainWindow',
-pos => [ 10, 10 ],
-size => [ 900, 900 ],
);

my $loginIDLabel = $MainWindow->AddLabel(
-text => "User ID:",
-pos => [ 10, 10 ],
);

my $loginPassLabel = $MainWindow->AddLabel(
-text => "Password:",
-pos => [ 10, 40 ],
);

my $loginIDTextFields = $MainWindow->AddTextfield(
-name => "LoginID",
-width => 150,
-height => 20,
-pos => [60,8],
);

my $loginPassTextField = $MainWindow->AddTextfield(
-name => "LoginPass",
-width => 150,
-height => 20,
-pos => [60,38],
-password => 1,
);

my $loginSave = $MainWindow->AddButton(
-name => "Save",
-text => "Save",
-pos => [ 50, 80 ],
);

my $loginReset = $MainWindow->AddButton(
-name => "Reset",
-text => "Reset",
-pos => [ 100, 80 ],
);

$MainWindow->Show();
Win32::GUI::Dialog();

sub Reset_Click {
#wish to reset the textfield content
return 0;
};

sub Save_Click {
#wish to call a subroutine
return -1;
};

thanks....


samir_gambler
New User

May 3, 2013, 12:06 PM

Post #2 of 2 (10705 views)
Re: [samir_gambler] Reseting textfield text [In reply to] Can't Post

Well I got the answer. I am writing the answer so that it might be helpful for someone else....

Code
$loginIDTextFields->Text("");


 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives