"AppendText" असाइन नहीं कर सकता क्योंकि यह एक "विधि समूह" है।असाइन नहीं किया जा सकता क्योंकि यह एक विधि समूह सी # में है?
public partial class Form1 : Form
{
String text = "";
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
String inches = textBox1.Text;
text = ConvertToFeet(inches) + ConvertToYards(inches);
textBox2.AppendText = text;
}
private String ConvertToFeet(String inches)
{
int feet = Convert.ToInt32(inches)/12;
int leftoverInches = Convert.ToInt32(inches) % 12;
return (feet + " feet and " + leftoverInches + " inches." + " \n");
}
private String ConvertToYards(String inches)
{
int yards = Convert.ToInt32(inches)/36;
int feet = (Convert.ToInt32(inches) - yards * 36)/12;
int leftoverInches = Convert.ToInt32(inches) % 12;
return (yards + " yards and " + feet + " feet, and " + leftoverInches + " inches.");
}
}
त्रुटि लाइन "textBox2.AppendText = पाठ", button1_Click विधि के अंदर चल रहा है।
धन्यवाद दोस्तों। क्षमा करें अगर मैं इतना मूर्ख था :( – puretppc
उह मैंने कोशिश की और यह काम किया लेकिन किसी कारण से, यह इसे एक नई लाइन में प्रदर्शित नहीं करेगा। – puretppc
क्या टेक्स्टबॉक्स में 'मल्टीलाइन = ट्रू' है? अगर लोगों में से एक नीचे आपके प्रश्न का उत्तर देते हैं, कृपया – Basic