0

Hi all ,
I want to disable a text box when i select a value from drop down list, but im not able to so can u please help me

This is my code:

Protected Sub type_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles type.SelectedIndexChanged
If type.SelectedItem.Value = "Income" Then
vc.Enabled = False
Else
vc.Enabled = True
End If
End Sub

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by usershan
0

There could be a few problems. the best idea is to use the debugger to see what value the if statement is actually comparing. use F9 to create a break point and then just move through the code. The debugger is the most powerful tool available to any programmer.

but you also might want to try

type.SelectedValue.ToString() = "Income"

hope that helps 8-|

0

Hello Sir
Thanks for ur reply, Sir this also i have tried to do but not able to, the problem is i have a text box and dropdown box with 2 values income and expenses, when i select income value then then voucher number text box should be disabled and if i select expenses then voucher number text box should be enabled. Kindly help me.

Thanku in advance

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.