Re: No TextBox method for clearing the selection
From: Edward Diener (eddielee_at_tropicsoft.com)
Date: 10/01/04
- Next message: Claes Bergefall: "Re: No TextBox method for clearing the selection"
- Previous message: Imran Koradia: "Re: No TextBox method for clearing the selection"
- In reply to: Joey Callisay: "Re: No TextBox method for clearing the selection"
- Next in thread: Joey Callisay: "Re: No TextBox method for clearing the selection"
- Reply: Joey Callisay: "Re: No TextBox method for clearing the selection"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 1 Oct 2004 00:16:05 -0400
Joey Callisay wrote:
> I am not a C++ guy and I just read the documentation for WM_CLEAR
> method. Perhaps the functionality of the said method is not that
> common since one can just manipulate the Textbox's Text property, I
> don't really know.
It has nothing to do with C++. The .NET api is for all .NET languages and
Windows messages exist for all programming languages which use the Win32
API. Normally if a Windows message exists for a control, the .NET way is to
provide a method, or property, which encapsulates the same functionality as
was previously used in Win32 when sending the message to the control. I was
just pointing out that, in this case, there is no equivalent method or
property which enables one directly to delete the current selected text from
the control. In all other cases of TextBox there are methods, or properties,
which allow the programmer to directly achieve the same effect as sending a
particular message to the control. I found that really odd because if
usually MS is going to make things simple for a .NET programmer by replacing
Windows messages with methods or properties, they will do it consistently
for each Windows message to which the control normally reacts.
As an example the TextBox::Copy() method does the same thing as sending the
WM_COPY message to the edit control. If you look you will see this is the
same for all edit control messages, including the WM_ and EM_ set except for
WM_CLEAR, which has no direct analogue. Of course the indirect analogue,
changing the Text with a new string which contains the old string but with
the selected text removed, works fine but this sort of manual calculation is
something which a good API normally avoids if there is a direct equivalent.
- Next message: Claes Bergefall: "Re: No TextBox method for clearing the selection"
- Previous message: Imran Koradia: "Re: No TextBox method for clearing the selection"
- In reply to: Joey Callisay: "Re: No TextBox method for clearing the selection"
- Next in thread: Joey Callisay: "Re: No TextBox method for clearing the selection"
- Reply: Joey Callisay: "Re: No TextBox method for clearing the selection"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|