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

Converting string to label

$
0
0
I am trying to make an app for work for computing dimensions. What I have is one form for entering data and another form that displays the results. I have a string array transferArray that stores the data to be transferred. Method to send array: public static string solution(int i) { return transferArray[i]; } I have labels set in the second form and I want set their text equal to solution(i) for each one. I won't list out everything here to save space but I have tried two ways. Neither is doing what I want. string countersink = Form1.solution(0); lblcountersink.Text = countersink; And lblcountersink.Text = (Controls[Form1.solution(0)] as Label).Text; When my second form opens the default labels are still the same and have not changed to the new values.

J


Viewing all articles
Browse latest Browse all 12583

Trending Articles



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