Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • *Experts*
Posted
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?

  • *Experts*
Posted (edited)
A checkbox cannot equal 1. Are you saying that if checkbox.Checked = True then textbox's text should be C? Edited by mutant
  • *Experts*
Posted

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.

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...