473,432 Members | 1,762 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,432 software developers and data experts.

Check Control's property name exist or name

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
4 7741
"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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
by: | last post by:
If I need to check if a certain value does exist in a field, and return either "yes" or "not" which query would be the most effestive?
2
by: Mike | last post by:
I´ve got a number of SPAN elements named "mySpan1", "mySpan2", "mySpan3" etc, and want to set their "style.display" to "inline". This works (only needs to work on IE5.5+): for (var x = 1; x <...
9
by: ckerns | last post by:
I want to loop thru an array of controls,(39 of them...defaults = 0). If value is null or non-numeric I want to assign the value of "0". rowString = "L411" //conrol name if (isNaN(eval...
15
by: Rey | last post by:
Howdy all. Appreciate your help with several problems I'm having: I'm trying to determine if the Visit subform (subformVisits) has a new record or been changed, i.e. dirty. The form that...
13
by: MLH | last post by:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) If LaborCost > 0 Then Me!LaborCost.Visible = True If MatlsCost > 0 Then Me!MatlsCost.Visible = True If OtherCost > 0 Then...
2
by: Vic | last post by:
Hi. Is it possible to make web form's check box control (and/or an HTML check box control) to have a thin fixed line for a box instead of a 3d box style. I'd like the check box to look similar...
6
by: Tom Kiefer | last post by:
Question: If I have an ASP.NET User Control which defines/exposes a property that the page can use to specify a mode or data subset for the control to use, is there a way to tell the @OutputCache...
2
by: Yoshitha | last post by:
In my webform i have 2 textbox controls and one button control. in 1st textbox control i'll enter email id when it lost its focus i've tocheck whether the entered email id exist in...
1
by: sianan | last post by:
I tried to use the following example, to add a checkbox column to a DataGrid in an ASP.NET application: http://www.codeproject.com/aspnet/datagridcheckbox.asp For some reason, I simply CAN'T get...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.