It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming Visual Basic Forum

Textbox textchange problem

Moderator: dafunkymunky

Textbox textchange problem

Postby Caligula on Wed May 04, 2011 7:21 pm

i have a problem
is there way to ignore a text change?
like this i have textbox1.textchange
private sub
............
a=textbox2.text
end sub

private sub
..........
textbox2.textchange

b=textbox1.text
if i do something like this it gives me an error
so i wanted i textbox2 textchanged to ignotre textbox 1 textchange is this possible?
Caligula
 
Posts: 15
Joined: Fri Apr 22, 2011 8:38 pm

Re: Textbox textchange problem

Postby jblues on Wed May 04, 2011 7:31 pm

Yous should send the whole code what you posted is misleading.

textbox1.textchange
private sub ' what are the conditions of the subroutine.
............
a=textbox2.text ' this looks like you are changing the value of textbox2 on the textchange event of textbox1 ?????
end sub

private sub
..........
textbox2.textchange

b=textbox1.text
' this looks like you are changing the value of textbox1 on the textchange event of textbox2 ?????
jblues
 
Posts: 13
Joined: Tue May 03, 2011 11:08 am

Re: Textbox textchange problem

Postby Caligula on Wed May 04, 2011 7:40 pm

Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

Dim a, b, c, d, e, f, g, h, i, j, l, m As Single

a = Form3.TextBox1.Text

b = a * 10
c = a * 100
d = a * 1000
e = a * 10000
f = a * 100000
g = a * 1000000
h = a * 24.5
i = h / 12
j = i / 3
l = j / 1760
m = l / 3
Form3.TextBox2.Text = b
Form3.TextBox7.Text = c
Form3.TextBox6.Text = d
Form3.TextBox5.Text = e
Form3.TextBox4.Text = f
Form3.TextBox3.Text = g
Form3.TextBox10.Text = h
Form3.TextBox11.Text = i
Form3.TextBox12.Text = j
Form3.TextBox9.Text = l
Form3.TextBox8.Text = m
end sub

Private Sub TextBox10_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox10.TextChanged

Dim a, b, c, d, e, f, g, h, i, j, l, m As Single
a = h / 24.5
b = a * 10
c = a * 100
d = a * 1000
e = a * 10000
f = a * 100000
g = a * 1000000
h = Form3.TextBox10.Text
i = h / 12
j = i / 3
l = j / 1760
m = l / 3
Form3.TextBox2.Text = b
Form3.TextBox7.Text = c
Form3.TextBox6.Text = d
Form3.TextBox5.Text = e
Form3.TextBox4.Text = f
Form3.TextBox3.Text = g
Form3.TextBox1.Text = a
Form3.TextBox11.Text = i
Form3.TextBox12.Text = j
Form3.TextBox9.Text = l
Form3.TextBox8.Text = f

end sub

what i want is if textbox1 text changes then textbox2 textchange command is ignored and vice-versa
Caligula
 
Posts: 15
Joined: Fri Apr 22, 2011 8:38 pm

Re: Textbox textchange problem

Postby jblues on Wed May 04, 2011 7:59 pm

Did you consider diabling textbox1 on the textchange event of textbox2 ?
jblues
 
Posts: 13
Joined: Tue May 03, 2011 11:08 am

Re: Textbox textchange problem

Postby Caligula on Wed May 04, 2011 8:05 pm

jblues wrote:Did you consider diabling textbox1 on the textchange event of textbox2 ?

do you mean disabling, yes i tried that.
what i wanted is to ignore textbox1 textchange but don't knoow if that's possible
Caligula
 
Posts: 15
Joined: Fri Apr 22, 2011 8:38 pm

Re: Textbox textchange problem

Postby jblues on Thu May 05, 2011 12:16 pm

Yes I meant disabling.
I am sure what you want to do can be done, but it will get more complicated.
I think you will want one textchange subroutine to govern all text change events.
so
Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged_TextBox2.Textchanged

Then is if then statementes within the subroutine.
Something like
if textbox1.txt = "" then commands
if textbox10.txt = "" then commands
eccc.
Hope this help.s
jblues
 
Posts: 13
Joined: Tue May 03, 2011 11:08 am

Re: Textbox textchange problem

Postby Caligula on Fri May 06, 2011 8:17 pm

Tanks for the help, but i was able to do it with this.
Dim bolBlockEvents As Boolen

Private Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged

If Not bolBlockEvents Then
bolBlockEvents = True
...do your code
bolBlockEvents = False
End If

End Sub

Private Sub TextBox2_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged

If Not bolBlockEvents Then
bolBlockEvents = True
...do your code
bolBlockEvents = False
End If

End Sub
Caligula
 
Posts: 15
Joined: Fri Apr 22, 2011 8:38 pm


Who is online

Users browsing this forum: No registered users and 1 guest

cron