|
if u run this i clicked 0123456789 ok now i selected 6789
wat do u mean by selecting 6789???
|
|
|
|
|
now all th numbers what i clicked is in editbox that are 0123456789.now what i done is by usig mouse i click on 6 and drag to 9 after that i click the delete button. so what i want is 6789 should delete after that if click another number it should display after 5.
vasu
|
|
|
|
|
if click another number it should display after 5.
you have buttons with numbers 0-9 on them. and right now u want that if u press any button it should print 5?
|
|
|
|
|
no
i already clicked all the button now in my editbox i have the number 0123456789 if i want delete 6789 from that num what should i do.
|
|
|
|
|
no,in my edit box i have 0123456789.i want to delete 6789 from that number when i click delete button.this delete button also in my dialog.
ok
|
|
|
|
|
should i use rich edit box to overcome this problem.
please tell me
|
|
|
|
|
sree_as wrote: should i use rich edit box to overcome this problem.
Not unless you need some functionality that it provides that a regular edit control does not.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
can u be more detail please
sree.
|
|
|
|
|
You've not provided any requirements that warrant a richedit control. A regular edit control will work just fine.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I think your problem can be solved in both cases. Both of Edit or Rich Edit controls have such programmatic feature.
|
|
|
|
|
can u tell me any examples or any relative links
thank u,
vasu
|
|
|
|
|
If you define a m_cMyEdit control variable for your edit control, then you can delete the selected text using this call:
m_cMyEdit.ReplaceSel("");
Add the above line in the handler for your Delete button.
It will work when something is selected. If your Delete button should delete entire content when nothing is selected, you can try this:
int start, end;
m_cMyEdit.GetSel(start, end);
if( start == end)
{
m_cMyEdit.SetWindowText("");
}
else
{
m_cMyEdit.ReplaceSel("");
}
|
|
|
|
|
thank u,
it's working.
but another small problem.
after deletion if u enter any number all again coming.
please solution for this also
|
|
|
|
|
In order to understand the new problem, can you give more details, maybe a sample.
|
|
|
|
|
again take 0123456789.we delete 6789 using ur code.after that i want to enter some more numbers so i click button 1.so it should display 0123451 but it is like 01234567891.
means it's not deleting in buffer.
this is my problem.
|
|
|
|
|
Perhaps the code for your button 1 actually does not insert a single character, but inserts the full string from a variable. Can you check what happens in your code when you click on numeric buttons?
|
|
|
|
|
thank u,
same problem,
what i mean button1 means button contains label 1
|
|
|
|
|
The button 1 seems to be a button control, and I think it contains some code associated with it. You should see which function is executed in your code when you click the "1" button, i.e. how the text is inserted into edit control.
|
|
|
|
|
in button one my code is like
m_text +="1";
UpdateData(false);
where m_text is member variable for edit box
-- modified at 9:20 Tuesday 13th June, 2006
|
|
|
|
|
Therefore the Windows works fine, but not how you expected. I think the handler for button 1 should be changed to:
m_cMyEdit.ReplaceSel("1");
where m_cMyEdit is the control variable of your edit control.
Try this first for button 1, then -- if works -- adjust all of your numeric buttons.
|
|
|
|
|
|
Associate the Control variable to your Edit Control and Use the methods like cut for deleting the selected text.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
thank u.
i tried it not working .
|
|
|
|
|
Use UpdateData function while updating the data of the Edit box.
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
DWORD dwSel =m_number.GetSel();
m_number.Cut();
int i=HIWORD(dwSel);
POINT pt;
pt.x=i;
pt.y=0;
m_number.SetCaretPos(pt);
m_number.SetFocus();
*****m_number is the control variable for the edit control with the number property set to true
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
-- modified at 8:18 Tuesday 13th June, 2006
|
|
|
|