Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to retrieve label value in window application
Posted
Comments
Aarti Meswania 30-Oct-12 2:39am    
Dim MyVar as string = YourlableName.Text
sofia3 30-Oct-12 2:40am    
no i have tried this but it is coming blank
Aarti Meswania 30-Oct-12 3:07am    
check events properly some where it is set to blank, then you are trying to fetch value so it is happening

comment all lines where that lable value is set to blank you will get result and root of problem.

Label has a Text property[^].
 
Share this answer
 
You need to get the value of Text Property of label control. Like:

VB
If label1.text <> "" Then
	Dim strLabelValue As String = label1.Text
End If


Note: If label has some value in Text Property then it will be assigned to strLabelValue.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900