Thread: Editbox help

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Jan 2006
    Posts
    4

    Editbox help

    Hi, im new to the fun world of C++, learning it gradually as i go...

    i have figured how to use the data the user enters in to an editbox like so

    Code:
    if(CheckBox21->Checked)
    {
    wac<<"if never() then"<<endl;
    wac<<"breathtime ="<<Edit3->Text.c_str()<<endl;
    wac<<"endif"<<endl;
    wac<<endl;
    }
    but what i would like to do, is divide the users input by half.

    so if they enter 20, it will create

    if never() then
    breathtime = 10
    endif

    in the wac file.

    any help with this would be appreciated

    Edit:

    ive added this to the "on key press" of the editbox

    Code:
    void __fastcall TForm1::Edit2KeyPress(TObject *Sender, char &Key)
    {
    if ((Key < 48 || Key > 57) && Key != 8) Key = 0;
    }
    so now only numerical datacan be entered.... just leaves the division
    Last edited by brad.g; 01-10-2006 at 02:21 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 08-25-2005, 03:09 PM
  2. Create two buttons that interact with an editbox
    By Arkanos in forum Windows Programming
    Replies: 8
    Last Post: 07-13-2005, 12:56 AM
  3. Create two buttons that interact with an editbox
    By Arkanos in forum C++ Programming
    Replies: 4
    Last Post: 07-11-2005, 01:17 AM
  4. editbox problem
    By tyouk in forum Windows Programming
    Replies: 7
    Last Post: 10-05-2004, 09:14 PM
  5. Editbox problems
    By Devil Panther in forum Windows Programming
    Replies: 9
    Last Post: 07-27-2003, 04:12 PM