Re: Help me with the edit text.

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

r_z_aret_at_pen_fact.com
Date: 01/18/05


Date: Tue, 18 Jan 2005 17:40:21 -0500

On 17 Jan 2005 09:45:01 -0800, torobravo@gmail.com (carlos) wrote:

>>On 11 Jan 2005 08:01:53 -0800 r_z_aret@pen_fact.com wrote:
>>

clip

>
>I copied an idea from the HexCalc sample in my copy of Petzold's book.
>Specifically, each pushbutton in my keypad has a label that specifies
>the corresponding character. When a user "presses" one of these
>buttons, I grab the first character of the label and send it to the
>edit box using WM_CHAR.
>
>>
>>Then, I introduce the number in a string and I send a couple of
>>messages, one to put the index in the appropiate position and the
>next
>>one to write the number.
>
>When I wrote "the edit box 'knows' the position...", I meant that my
>program does _not_ move the cursor/index. I let the default window
>proc associated with the edit box do all that work _and_ handle the
>WM_CHAR messages I send. That way the user can reposition the cursor
>to insert a characters in the middle of a string or add them at the
>end. The user can even add text to the edit box by some other method
>(I'm finding this hard to describe. But it really is simpler than your
>approach _and_ nicer for users.)
>
>
>>
>>Finally , I would like to introduce this number in a file. But when I
>>try to do that the program crash.
>
>I need more info to determine the source of this problem. If I wanted
>to copy text from an edit box to a file, I would use GetWindowText to
>get the string, and then write that string to a file. That leaves
>several places where a programmer could introduce errors that cause a
>crash.
>
>
>>
>>All these things are what I am trying to do with the previous code.
>>However it doesn´t work. Your idea is to use a WM_CHAR but where. I
>>mean, if a introduce this message in my program where I have to put
>>it, and even more, this message I suppose that it is sent when
>someone
>>writes in the edittext.
>
>I _think_ I answered these questions above. But I'm not sure I
>understand the questions.
>
>
>>
>>Anyhow, thank you very much for your help and if you know how to
>solve
>>this problem, I would be glad to receive your help.
>>
>>Carlos

>
>Hi again!
>I have tried to solve my problem with the edittext using the example
>that you tell me. However when I try to put in my program it doesn´t
>work. What I have done is:

I'm sorry, but I just don't have the patience to read so much code.
Some folks who frequent this newsgroup do have such patience, so maybe
one of them will pipe up. If you post a smaller piece I'll try to
check it. Or at least provide a summary and strong hints where I
should look. I also really would like more details than "it doesn't
work". What symptoms are you seeing? I can tell you use GetLastError
in one place. What did it return? Also, you should check the
description of _every_ function you use and call GetLastError whenever
the description says it is appropriate.

clip

-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
500 Harrison Ave., Suite 3R
Boston, MA 02118
www.penfact.com



Relevant Pages

  • GD graph labels: degree symbol?
    ... label text string like 'Degrees °C' ... I use vi to edit everything, but I've no idea whether I need to ... Prev by Date: ...
    (comp.lang.perl.misc)
  • RE: Determining max. length of text that can be entered for anothe
    ... string; the size I get back implies that all of the text in the text box will ... fit into the label box w/o clipping, ... Dim stringFont As New Font ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Strings and symbols
    ... See, the label on each push-button is a string, not a symbol. ... and thus "interning" the resulting symbol. ... concatenating doesn't do interning so it wouldn't "thus" intern the ...
    (comp.lang.lisp)
  • Re: Best Method
    ... dim dcfirstcolumn as new datacolumn ... >> first field would be a string... ... > Private _Label As String = String.Empty ... > Public Sub New(ByVal label As String, ByVal theDate As DateTime) ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Using handles and editboxes
    ... My edit is called editbox1 and the 'String' = r to make the line red. ... A Handle Graphics handle is sort of like the 'phone number' of the Handle ...
    (comp.soft-sys.matlab)