Hi,
I have created a small GUI for login window. I want to add the feature of 'tab'. So that if the user click tab key while on one text field it set the focus to next text field which is a typical behavior of a form.
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;
};
Can any one please suggest how to achieve it.
Thanks in advance
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.