flopes Posted November 17, 2003 Posted November 17, 2003 hi i nead help for this: I have a textbox that i whant to fil from a checkbox . If checkbox=1 then textbox=C and if textbox="" then checkbox=0 Please help Quote
*Experts* mutant Posted November 17, 2003 *Experts* Posted November 17, 2003 hi i nead help for this: I have a textbox that i whant to fil from a checkbox . If checkbox=1 then textbox=C and if textbox="" then checkbox=0 Please help Im not sure Im getting your problem... Are you trying to put some text into the textbox when checkbox is checked and other text if checkbox is not checked? Quote
flopes Posted November 17, 2003 Author Posted November 17, 2003 here it is i heve a " Textbox" that i whant to fill from the "Checkbox" So if "Checkbox=1" then "Textbox will be fill with a "C" thanks lopes Quote
*Experts* mutant Posted November 17, 2003 *Experts* Posted November 17, 2003 (edited) A checkbox cannot equal 1. Are you saying that if checkbox.Checked = True then textbox's text should be C? Edited November 17, 2003 by mutant Quote
*Experts* mutant Posted November 17, 2003 *Experts* Posted November 17, 2003 If that is the case you could do this: If checkbox1.Checked Then textbox1.Text = "C" Else textbox1.Text = "Text that is supposed to be here when not checked" End If This will check if the checkbox is checked, and if yes wil change the text to C and if not then change the text to something else. Quote
flopes Posted November 17, 2003 Author Posted November 17, 2003 yes it work but how can why does the "checkbox" dosen´t come out whin the Textbox Chang? Quote
Administrators PlausiblyDamp Posted November 17, 2003 Administrators Posted November 17, 2003 You also want the checkbox to uncheck if the textbox changes? correct? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
flopes Posted November 17, 2003 Author Posted November 17, 2003 yes sorry abaut my inglish. Thanks Quote
flopes Posted November 17, 2003 Author Posted November 17, 2003 yes that´s so because like that when i search tho the dataset that checkbox will chang. thank´s Quote
flopes Posted November 17, 2003 Author Posted November 17, 2003 i Think that this is a better sulution???? Private Sub editQuantidades_Fornecidas__C__TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles editQuantidades_Fornecidas__C_.TextChanged If editQuantidades_Fornecidas__C_.Text = "C" Then labQ9.ImageIndex = 0 If editQuantidades_Fornecidas__C_.Text = "" Then labQ9.ImageIndex = -1 End Sub Private Sub labQ9_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles labQ9.Click Dim lab As Label = sender If lab.ImageIndex = 0 Then lab.ImageIndex = -1 Else lab.ImageIndex = 0 If lab.ImageIndex = 0 Then editQuantidades_Fornecidas__C_.Text = "C" If lab.ImageIndex = -1 Then editQuantidades_Fornecidas__C_.Text = "" End Sub Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.