>>I think there's a simple answer to this but I can't think of it or find it.
>>I want to set the character casing of all textboxes on a form to upper.
>>I get this far and can't access the charactercasing property of the control.
>>Any help appreciated.
>>
>>
>> foreach (Control c in parentForm.Controls)
>> {
>> if (c is TextBox)
>> {
>>
>> }
>> }
>>
>
>Did you try instead (not tested)
>
>var c as TextBox
>
>if (c!=null)
> {
>
> }
>
>See
>
>
https://msdn.microsoft.com/en-us/library/cscsdfbt.aspx?f=255&MSPPError=-2147217396Thanks, Naomi
I woke up from my trance and this did it
foreach (Control c in parentForm.Controls)
{
if (c is TextBox)
{
TextBox tb = c as TextBox;
tb.CharacterCasing = CharacterCasing.Upper;
}
}
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.