First off, this is a homework assignment. I am in a Software Engineering class and we're learning how to work with MFC. We're editing a basic calculator app. I don't know how to implement the backspace button (delete a single character from the edit box when the Backspace button is pressed). How is this done? I know that you can emulate character deletion with manipulation of char arrays in C++, but I don't know how you would do this with a number and in MFC. The application uses double integers.

Member Avatar
Member Avatar
+0 forum 3

Hi, I'm an absolute beginner in Visual C++ (Express Edition 2010). I've just been trying out this very simple program, and I can't get to use the '\b' tag like I did when I used Turbo C++ v4.5. The cursor moves backwards, but the text does not get erased, as it did with Turbo C++. The code is: [CODE] #include<iostream> #include<conio.h> using namespace std; void main() { cout<<"Hello"; cout<<"\b\b"; _getch(); } [/CODE] The output is Hel[U]l[/U]o (Underline represents cursor position). What am I doing wrong? Any help would be appreciated.

Member Avatar
Member Avatar
+0 forum 1

Alright, I have Textbox where I want only Numbers and Letters and backspace allowed. I don't want copy and paste, or spacebar or other ascii charachters. Can anybody help me?

Member Avatar
Member Avatar
+0 forum 1

Can someone help me please. I am using a Scanner Class and want to count characters entered in the textfield. Unfortunately, backspace and any key (Ctr,Alt,Capslock) for that matter is counted as a character and that increments the counter by 1. Here is the code [code] String ab="^[A-Za-z0-9]+$"; public void keyReleased(KeyEvent ke) throws NoSuchElementException{ Scanner scann=new Scanner(Jtextfield.getText()); { String sarwa=scann.next(ab); if(true) i++; champo.setText(" "+Integer.toString(i)); } [/code] Thankyou, ARZ

Member Avatar
Member Avatar
+0 forum 5

The End.