Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Changing text labels dynamically

$
0
0

Hi 

Am using C# to develop a windows form application.

I have a form with TextLabel controls

The caption of each TextLabel is saved in a database table having two column Label_Id and Label_Caption. Each TextLabel on my form Name property set to a value in the  Label_Id field in my Table.

Here is my question.

How can I loop throught all TextLabel controls displayed on my form changing the Caption of each one 

based on the values  returned from my database. The labels are gotton from comparing the  TextLabel Name ==> Label_Id

If they match the  TextLabel Caption is Set to the value ==> Label_Caption for the record.

I tried using associative arrays but dont no what am missing

Can any one be of help.


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>