private void btn_comprarProduto_Click(object sender, EventArgs e) { string historico; if (MessageBox.Show("Deseja comprar esse produto?", "Atenção", MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK) { //n esta efetuando a compra quando comprasse um produto que tenha ".". //Erro var precoCerto = float.Parse(String.Format("{0:#.00}", listView_consumables.SelectedItems[0].SubItems[4].Text.Replace("R$", ""))); if (string.IsNullOrEmpty(guest.gue_historico)) { historico = ""; } else { historico = guest.gue_historico; } historico += listView_consumables.SelectedItems[0].SubItems[1].Text + "/" + listView_consumables.SelectedItems[0].SubItems[4].Text + "/"; guest.gue_historico = historico; guest.gue_precoTotal += precoCerto; guestController.alterarGuestPreco(guest); if (Application.OpenForms.OfType <ReadGuestScreen>().Count() > 0) { ReadGuestScreen form = Application.OpenForms["ReadGuestScreen"] as ReadGuestScreen; form.listar(0); } btn_comprarProduto.Enabled = false; MessageBox.Show(listView_consumables.SelectedItems[0].SubItems[1].Text, "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Information); } }