To get the control instead before doing the EditLabel() stuff.
Tom,
Thanks so much for quick reply. However, the one thing you suggested was
the
one thing I had already tried (to no avail). However, maybe I am doing
something wrong. Here is my code:
int SerialNumberList::InsertRow (Row& rowData) {
[...]
int item = InsertItem(GetItemCount(), rowData.at(1).c_str());
SetItemText(item, 1, rowData.at(0).c_str());
// Start New Code
SetFocus(); // EditLabel() returns a null pointer without this for some
reason
CEdit* edit = EditLabel(item);
edit->ModifyStyle(0, ES_UPPERCASE);
// End New Code
[...]
}
This code appears to have absolutely no effect (if I type lowercase chars,
they appear as lowercase).
Also, since ModifyStyle() employs SetWindowLong(), I was looking at the
documentation for SetWindowLong() and saw this:
"Certain window data is cached, so changes you make using SetWindowLong
will
not take effect until you call the SetWindowPos function. Specifically, if
you change any of the frame styles, you must call SetWindowPos with the
SWP_FRAMECHANGED flag for the cache to be updated properly."
As a result, I also tried changing
edit->ModifyStyle(0, ES_UPPERCASE);
to
edit->ModifyStyle(0, ES_UPPERCASE, SWP_FRAMECHANGED);
but that didn't seem to make any difference.
Any more help/ideas would be greatly appreciated!
"Tom Serface" wrote:
I'd start by just setting it in the edit control you get in EditLabel()
http://msdn2.microsoft.com/en-us/library/4xxsdd7z(VS.80).aspx
I haven't tried it, but I think you can call ModifyStyle()
http://msdn2.microsoft.com/en-us/library/0xhz2t1c(VS.80).aspx
With the style:
ES_UPPERCASE
http://msdn2.microsoft.com/en-us/library/6e36b89f(VS.80).aspx
Tom