Sensing a keyboard press in a forms app?

In a windows form, I have a button. When that button is pressed, I want it to look for keyboard presses. When the spacebar is pressed 10 times, I want the button to do something. Is this at all possible?
In Calculus, 1+1=0.

I guess that you have only one button and one label in the form so that button1 is focused by default when Form1 loads. You set button1.Enable = false, Form1.LostFocus so that keyevents do not work.
Please try to use the following code it works well
public partial class Form1 : Form
int i = 0;
public Form1()
InitializeComponent();
this.KeyPreview = true;
this.KeyPress += new KeyPressEventHandler(Form1_KeyPress);
private void button1_Click(object sender, EventArgs e)
button1.Enabled = false;
this.Focus();
private void Form1_KeyPress(object sender, KeyPressEventArgs e)
if (e.KeyChar == (char)Keys.Space)
i += 1;
label1.Text = "Worked !";
if (i == 10)
button1.Enabled = true;
Hope above help !
Doanh
  

Similar Messages

  • Why can't I use keyboard to sign in to apps after ios7 download?

    After downloading the latest ios on my ipad, I cannot use the keyboard to log into an app that keeps my passwords secret.  I also downloaded the update, but still cannot use it.  The keyboard does not appear in order for me to type in my password.

    What happens when you try... any Error messages or Alerts...
    Try This...
    Close All Open Apps...  Sign Out of your Account...  Perform a Reset... Try again...
    Reset  ( No Data will be Lost )
    Press and hold the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears. Release the Buttons.
    http://support.apple.com/kb/ht1430

  • How to find out which button is pressed in a form?

    I want to know which button (Insert, Update, Delete) the user has pressed in a form in Portal 9.0.2.3.
    My form is launched so that the ID column is fixed (and hidden). Unfortunately when user presses Insert, the value of the ID is lost. I have tried to work-around this by calling the form again after successful submission. And also I'm trying to improve actions so that the form window is closed if Update or Delete is pressed.
    I have got some solutions from Metalink. My problem is that they not working all the time. E.g. solution below worked this morning, but not anymore (after I have changed the form)! Have I made errors or are solutions shown in Metalink only for Portal v3.xx?
    My code in 'On successful submission of a from..' field:
    DECLARE
    l_action varchar2(20);
    v_id number;
    BEGIN
    -- get the action performed
    l_action := p_session.get_value_as_varchar2(
    p_block_name => 'DEFAULT',
    p_index => 1,
    p_attribute_name => '_STATUS');
    -- If the action is insert then call this form again
    -- If the action is update or delete then close this window
    if (l_action = 'Inserted one record.') then
    v_id := p_session.get_value_as_number(
    p_block_name => 'DEFAULT',
    p_index => 1,
    p_attribute_name => 'A_ID');
    go(PORTAL.wwv_user_utilities.get_url('PROVIDER.LINK_TO_FORM', 'id', v_id));
    else
    go('http://server/closewindow.htm');
    end if;
    END;
    When debugging the code, variable l_action is always null.
    Best regards
    Rainer

    Hi Satish,
    Check this blog -
    /people/alwin.vandeput2/blog/2006/04/13/how-to-search-for-badis-trace-it
    Check Clemens reply in this thread, its great-
    BADI
    <b>Reward Points if this helps,</b>
    Satish

  • Hello, Honestly I just updated my 4s and my iPad 3 to iOS 6 and when try to press on the Music app or the iTunes app it says "cannot connect to iTunes Store" Could you please help me with this thank you so much, Charbel from Lebanon

    Hello, Honestly I just updated my 4s and my iPad 3 to iOS 6 and when try to press on the Music app or the iTunes app it says "cannot connect to iTunes Store" Could you please help me with this thank you so much, Charbel from Lebanon

    See these previous discussions help.
    App Store Updates (but only Updates)...: Apple Support Communities
    Apps suddenly don't update: Apple Support Communities

  • PS CS6 Keyboard Shortcuts in Spreadsheet Form?

    I know there are lots of sources for keyboard shortcuts in PDF form.  But I was hoping someone might know of a source for a list (or summarized) shortcuts tabularted in spreadsheet form (or exportable to a spreadsheet).  Thanks.

    Thanks.  I never knew you could do that directly from htm file.  it gets me much, much closer to what i need with huge savings on typing of shortcut items.  I'm going to work on creating a spreadsheet that makes finding unused shortcuts easier (for future keyboard assignments).  Thanks again.

  • How to close open cursors in a forms app

    All,
    I'm not a forms developer. I'm a database administrator so I'm asking this question from that perspective. I know nothing about forms development.
    We have several forms applications that appear to hold many SELECT cursors open when they run. I've asked my forms developers about this and they are giving me the idea that they don't have much control over this. I have no idea myself so I'm asking here.
    When one issues selects from a form, do those selects remain as open cursors while the form runs? Is it possible to close those select cursors from within the form so that the application does not keep so many cursors open simultaneously?
    I am typically seeing a forms application with 70-100 open cursors. And we have hundreds of end users each running the forms application which is causing a lot of problems with the sheer number of open cursors.
    I've already bumped the database OPEN_CURSORS parameter but it's my feeling that developers should be doing a better job of closing cursors from within the form.
    Can anyone give me some guidance here or point me to some documents that describe how to reduce the number of open cursors to the database from a forms app?
    Thanks,

    There are several ways Forms use cursors. In the standard default method, users enter a query where condition and then execute the query. This process opens a cursor on the server, and the form fetches a few (20 or so) rows and displays on the screen (in a base-table "block"). If the user scrolls down, more rows are fetched from the cursor. This can go on and on if the user keeps scrolling down through the data. I am not sure when the cursor gets closed -- there is no Forms command to close this one. Only closing the form, or else re-executing the query process would close such a cursor.
    In the PL/SQL code, where the developer has control, a cursor can be opened, rows fetched, and then closed. This can be done either with Open-Fetch-Close or in a For... Loop. The developer can explicitly close this cursor, or PL/SQL theoretically closes the cursor when the block of code is exited.
    There is of course the SQL Select into, but that only works in PL/SQL for single-row selects. I doubt this is a major problem.
    And finally, there are the record groups, where Forms runs the select to draw all the data into an array in the form. These should be closed automatically, I believe.
    Now... if you can determine which tables the cursors are remaining open, maybe your developers can zero in on the forms, and maybe clean up some things. However, I am doubtful much can be done. It seems to me that if the open cursors are causing some database sluggishness, then maybe adding more memory on the server is the best option.

  • How to create an EventListener for a specific keyboard press?

    Hello,
    I have been trying to figure out how to switch my actionscript3 from a mouse click to a keyboard press. I'm new to Flash, but the problem I keep coming to is that I need to have 3 separate keys programmed in to do three seperate outcomes. I have messed around with eventListeners for keyboard presses, but I cannot figure out how to have flash listen for a specific key press and then do an action based on that specific key press.
    Here is my actionscript. Any suggestions on how I can modify the mouse clicks to be keyboard presses, where key 's' = btn1 and triggers gotoAndPlay(2), 'g' = btn2 and triggers gotoAndPlay(3), 'k' = btn3 and triggers gotoAndPlay(4) as outline below. I also need my timer and writing to an exteral file to remain the same.
    stop();
    var startTime:Number=getTimer();
    var elapsedTime:Number;
    stream.writeUTFBytes("Item1,");
    function BTN1Action(eventObject:MouseEvent) {
         elapsedTime = getTimer() - startTime;
              stream.writeUTFBytes("Tar1,");
              stream.writeUTFBytes(elapsedTime.toString());
              stream.writeUTFBytes("\n");
              gotoAndPlay(2);
    function BTN2Action(eventObject:MouseEvent) {
              elapsedTime = getTimer() - startTime;
              stream.writeUTFBytes("Tar2,");
              stream.writeUTFBytes(elapsedTime.toString());
              stream.writeUTFBytes("\n");
              gotoAndPlay(3);
    function BTN3Action(eventObject:MouseEvent) {
              elapsedTime = getTimer() - startTime;
              stream.writeUTFBytes("Tar3,");
              stream.writeUTFBytes(elapsedTime.toString());
              stream.writeUTFBytes("\n");
              gotoAndPlay(4);
    BTN1.addEventListener(MouseEvent.CLICK, BTN1Action);
    BTN2.addEventListener(MouseEvent.CLICK, BTN2Action);
    BTN3.addEventListener(MouseEvent.CLICK, BTN3Action);
    Any assistance with this is greatly appriciated. 

    Assuming you want to monitor key press on the button BTN1, you can do following:
    // Add a key up event listener on the button (or on the source where the key press needs to be captured)
    BTN1.addEventListener(KeyPress.KEYUP, BTN1KeyUpAction);
    // BTN1KeyUpAction sample, you can modify this
    function BTN1KeyUpAction(e:KeyboardEvent):void {
        if(e.keyCode == Keyboard.S) {
        gotoAndPlay(2);

  • Conversion of forms app to adf and 'user'

    we are about to task the conversion of a forms app to adf.
    there is a lot of back end pl/sql code, audit triggers that use the 'user' built in function call which will not be of much use if the adf application is going to login as one user and set a username in the security context or something of that nature.
    do we have no choice but to go through and change the 'user' function call to something else?
    doesn't this make it difficult to support the app using the oracle designer tool and the generated table api?
    any information on axioms regarding this problem most appreciated.

    By default your application will use one user to connect to the database via a connection pool, which is the preferred option for scalability. However if you're building a new application on top of a large Oracle database legacy system where this doesn't suit, you can change ADF's default behaviour to use something called "Dynamic JDBC Credentials". In this mode, the username/password is used to login to the database, effectively using the user's credentials to connect to the database, and essentially the database user function will return the desired result.
    So for you it's a question of:
    a) If ultimate scalability is the priority, convert your existing code over to stop using "user"
    b) If scalability is not a priority, but supporting your legacy database infrastructure is, go with the Dynamic JDBC Credentials option.
    CM.

  • Default db when login into a forms app

    Hi all,
    When I go to a forms app in my browser, I'd like the forms server uses a default database in case the end user leave such field in blank. I tried appending LOCAL=mydb in the env file defaults.env, but it not worked. mydb is corretly seted in the tnsnames.ora file.
    Is there another way to do this? Is there something I'm doing wrong?
    Thanks!

    U need to use the get_appplication_property to catch the database username, password and connect string.
    If u want the default values to appear here, then before the user logs in try to login with guest username and connect string and then logout. Next time when it prompts it will show the username and connect string.
    In our implementation we have a guest username and it logs to the database as soon as the appln is launched. Each username is same as the default windows OS username and using webutil we get the username. So when an end user tries to login, it automatically displays the username & connect string. They just need to enter the password.
    Rajesh ALex

  • Send message to NT Forms app from Linux Server

    I have an external process(C) automatically inserting data into
    Oracle8.0.5 database. On a before insert DB trigger I run another
    C procedure to compare new insert to existing data.
    If certain conditions are met, I need to notify any user of a
    separate Forms5 app that these conditions exist. How can I
    automatically communicate this information to Forms users?
    I would appreciate any suggestions.
    Thanks
    Note: DB and C processes running on Linux server, Forms app on
    WIN 98/NT clients.
    null

    Bev (guest) wrote:
    : I have an external process(C) automatically inserting data
    into
    : Oracle8.0.5 database. On a before insert DB trigger I run
    another
    : C procedure to compare new insert to existing data.
    : If certain conditions are met, I need to notify any user of a
    : separate Forms5 app that these conditions exist. How can I
    : automatically communicate this information to Forms users?
    : I would appreciate any suggestions.
    : Thanks
    : Note: DB and C processes running on Linux server, Forms app on
    : WIN 98/NT clients.
    Bev;
    If I understood correctley, you are using forms bulider 5.0.
    Then there is a trigger WHEN-TIMER-EXPIRED that can be used that
    in certain time or timer go against DB and verify that logic has
    been met and also a MESSAGE box can be added to your future.
    null

  • Open Oracle Forms app from APEX

    How can I open an Oracle Forms application from within APEX?
    Right now, the Forms app is accessed simply through a Bookmarked hyperlink, so it seems to me I should be able to open a browser window and send it the same url from within APEX. Can someone provide all the details please? Thank You.

    I don't know about Oracle Forms specifically... but you should be able to put a link to any arbitrary URL within your Apex application, and have the browser access that URL.
    For instance, you can create a button and set that URL as the button's location, or create a Display-Only item with a default value set to a block of HTML including an &lt;a href&gt; tag.

  • Example Oracle Forms app viewable online?

    Hi,
    Can anyone point me to an example Oracle Forms app available online using IE and Jinitiator?
    I don't have the environment to run demo code, and am not interested in the code itself, I simply want to run an app in IE to try to replicate a conflict between jinitiator and an IE Add-in that I'm responsible for.
    thanks,
    - Rory

    Our browser Add-on is only available for IE, and the problem only happens when the add-on is running. So we've not tried Firefox but it wouldn't help unfortunately.
    - Rory

  • 10g Forms App on Mac

    I'm having difficulty understanding the problem I'm having with getting our forms app to come up on a Mac. The user has tried several browsers and has gotten error FRM-92050. I looked this up on metalink but the solution was linux related so I don't believe it applied in our case.
    I wonder if there is some configuration I need to do or something on the mac I need to do. I'm very unfamiliar w/ Macs so any assistance with this would be helpful.
    The forms app is a recent upgrade from 6i to 10g of which I am still working on but I have enough completed to run tests on our users' machines.

    I have experienced the same problem. The error message is FRM 92050 Failed to connect to the server /forms90/l90servlet-1
    details...
    java Exception:
    java.io.IOException:Negative content length from http://192.168.1.254:7777/forms90/f90servlet?config=dominio&acceptLanguage=it-it,it;....
    I haven't any problems on Windows or linux.
    Is there someone who knows the solution?

  • Acrobat reader mouse and  pointer change by keyboard press

    Hey i need to change mouse and  pointerby keyboard press.
    When i have "pointer" and press "space" i can't move page...
    but the mouse shows up.
    9.5.0

    Up, why this is still without answer ?!
    you can tell me in
    11.0.9
    i don't care :/

  • Problem with Cyrstal Report viewer in a Windows Form App Franework 4.0

    I appear to have a issue with Cyrstal Reports runt-time 13.0.2000.0 in a Windows 7 64 bit environment.
    Crystal Report Viewer is not displaying the report but instead is displaying the logon screen with the database name missing.
    1.) App is a .net windows form app using 4.0 framework compiled in the visual studio 2010.
    Compile machine has the development evironment for crystal report 13.0.2000.0 loaded. Compiled for any CPU.
    The Viewer is setup to access the report using oledb conection with sql server using SQL authentication.
    The Viewer works great for all enviroments except for windows 7 64 bit.

    Hello,
    Set your project for X64 only, and note for 32 bit OS then set it for x86. It's a MSIExec issue and not CR. If MSIExec detects a 64 bit OS but your app is using 32 bits then you'll run into distribution problems.
    If you are using MS SQL Server 2008 then you have to install the Client Tools and select the SQL Native 10 driver. MS doesn't support MDAC DB drivers to MS 2008. Search MS's site for more info.
    You also need to install the 64 bit Client Tools for this to work on a 64 bit OS's.
    If you are using SQL 2005 then you have to use the MS OLE DB Provider for SQL Server, Cr doesn't support the Native driver for 2005.
    I use this configuration all the time so it should work.
    Also, are you using SP 1? The GAC Assembly version always stay the same, it's the dll version we need to know.
    Don

Maybe you are looking for

  • Installation problem on LG cg225

    Hi all, I'm working on one application whose jar size is 175K. While installation I'm getting OutOfMemory error. The max jar size of the device is 300K, what must be the problem. Thanks in advance. Regards, Sushil

  • How to send an email to the customer after generating Invoice in Receivable

    Hi, package oracle.apps.xdo.ebsdelivery; import oracle.apps.xdo.delivery.DeliveryManager; import oracle.apps.xdo.delivery.DeliveryRequest; import oracle.apps.xdo.delivery.DeliveryPropertyDefinitions; import java.sql.Connection; import java.sql.Driver

  • Which iMac 27 upgrades for Autodesk Revit and 3ds Max

    Hi, I am an architecture student and I'm about to purchase a iMac 27. I will be using bootcamp to run Revit and 3ds Max and was wondering what upgrades I should make (if any). 512GB SSD or a 1TB fusion drive 3.4GHz Quad-core Intel Core i5 or a 3.5GHz

  • Admin password required for stopped queue

    I am running 10.5.4 iMac G5 clients and 10.5.5 servers at my schools. We use mostly GCC 12 series laser printers with a few HP models of varying vintages thrown in. My users are experiencing frequent pauses or stops of their print queues. They are un

  • Calendar won't sync

    Ever since I installed the most recent iTunes upgrade (11.0.1) on my iMac, the calendar on my iMac does not sync to my iPad 2. This function worked fine until this latest version of iTunes. I am in the Info tab, which is where I used to be able to sy