0
I have been developing a new application I really need to increase the variable
public string malcoins = "0";
good to begin I will not be able to put the code all because it is very big and here accept only to a certain number of characters I tried before without success. good here in this part of the code I need to increment the variable and then refresh the variable which is supposedly a type of score given to the user or withdrawal here varialvel is put in a label
label2.Text = malcoins;
and here when the user clicks on the
private void button1_Click(object sender, EventArgs e)
{
Clipboard.SetText(messageTextBox.SelectedText);
Process.Start(Clipboard.GetText());
malcoins = Convert.ToInt32(malcoins) + 100;
deletemenssage();
}
I tried so with the code assima but without success of eleminar error.
Error 1 Cannot implicitly Convert type 'int' to 'string'
Testform.Cs 961 24
The variable malcoins was declared as string, you’re trying to assign an integer at the click of the button.
– Geilton Xavier Santos de Jesus
Malcoins needs to really be a string ?
– LP. Gonçalves
not actually can’t be an int but I don’t know how to put the int value later on label.text = malcoins and always give me that error
– Helder Da Silveira Ventura
If you are running calculations where the results are always integers it is interesting that malcoins are of type int and not string. To assign in label.Text only use malcoin.Tostring();
– LP. Gonçalves