.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 22nd, 2004, 10:22 PM
ayan ayan is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 27 ayan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
C#: determining type of control

i'm a new to this thing, so please be gentle. and thanks in advance.. hehe... how do i do this? let's say i have controls in the group box and i want to determine whether the control is a textbox or not... if so, clear it....

psuedo code...

- foreach(control c in groupbox.controls)
- if c is textbox, c.text=string.empty

thanx again...

--ayan

Reply With Quote
  #2  
Old February 23rd, 2004, 02:30 AM
ayan ayan is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 27 ayan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
hello there... hehe... the answer is just the "is" word...
PHP Code:
foreach(Control c in groupBox1.Controls){
  if(
c is TextBoxc.Text=string.Empty;



Reply With Quote
  #3  
Old August 3rd, 2012, 10:50 AM
Paulo Santos Paulo Santos is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2012
Posts: 1 Paulo Santos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 28 m 9 sec
Reputation Power: 0
One line dude:

foreach (var c in panel.Controls.OfType<TextBox>()) c.Text = string.Empty;

Reply With Quote
  #4  
Old August 4th, 2012, 07:32 AM
AnnieCalvert AnnieCalvert is offline
Permanently Banned
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2012
Posts: 5 AnnieCalvert Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 1 h 57 m 5 sec
Warnings Level: 10
Number of bans: 1
Reputation Power: 0
Simply use riveting and rivetingly simple! Method.It even works from Control Arrays and can be called from events other than GotFocus such as Change and Keydown...
dapfor.com/en/net-suite/net-grid/tutorial/data-types

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > C#: determining type of control

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap