By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,769 Members | 1,819 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,769 IT Pros & Developers. It's quick & easy.

Check Control's property name exist or name

P: n/a
Hi,

I have created a form , and have a different controls on them. I want to
check that control has particular property name or not.

I wrote following code , tell me what I missing :-
Dim ctl As Control

For Each ctl In Me.ParentForm.Controls

' IsPropery(ctl.

Next

Thanks in advance.

Hardik Shah

Nov 23 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"Hardik Shah" <ha********@hotmail.com> schrieb:
I have created a form , and have a different controls on them. I want to
check that control has particular property name or not.

I wrote following code , tell me what I missing :-
Dim ctl As Control

For Each ctl In Me.ParentForm.Controls

' IsPropery(ctl.

Next


\\\
Imports System.Reflection
..
..
..
.... = ctr.GetType().GetProperty(...)
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Nov 23 '05 #2

P: n/a
Hardik,

You can use reflection to get a list of properties of the
control.
http://www.vb-tips.com/default.aspx?...8-7d02cf64d537

Ken

Ps Any time I replied to an email you sent me it was returned saying there
were permanent problems with you email server.

----------------------------
"Hardik Shah" <ha********@hotmail.com> wrote in message
news:e5**************@TK2MSFTNGP15.phx.gbl...
Hi,

I have created a form , and have a different controls on them. I want to
check that control has particular property name or not.

I wrote following code , tell me what I missing :-
Dim ctl As Control

For Each ctl In Me.ParentForm.Controls

' IsPropery(ctl.

Next

Thanks in advance.

Hardik Shah

Nov 23 '05 #3

P: n/a
Hi,

Thanks for your previous reply.

I have a form that have controls . some of them have EnableMode property. I
want to do process to that control and want to know its value. I wrote
following commands, pl. tell what I am missing.
Dim ctl As Control
Dim str As String

For Each ctl In Me.Controls

MessageBox.Show (ctl.GetType.GetProperty("EnableMode")...)

Next
Thanks in advance.
Hardik.

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uf*************@TK2MSFTNGP11.phx.gbl...
Hardik,

You can use reflection to get a list of properties of the
control.
http://www.vb-tips.com/default.aspx?...8-7d02cf64d537
Ken

Ps Any time I replied to an email you sent me it was returned saying there
were permanent problems with you email server.

----------------------------
"Hardik Shah" <ha********@hotmail.com> wrote in message
news:e5**************@TK2MSFTNGP15.phx.gbl...
Hi,

I have created a form , and have a different controls on them. I want to check that control has particular property name or not.

I wrote following code , tell me what I missing :-
Dim ctl As Control

For Each ctl In Me.ParentForm.Controls

' IsPropery(ctl.

Next

Thanks in advance.

Hardik Shah



Nov 23 '05 #4

P: n/a
Hardik,

If you know the type of the control, you dont need Reflection
I suppose this is applicable to winform control, which you created

so
dim typename as string
for each ctrl in Me.Controls
typename = TypeName(ctrl)
if typename = "mycommandbutton" then
msgbox ctrl.EnabledMode
end if
next

Please excuse my vb.net syntax
Does this help ?

Kalpesh

Nov 23 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.