Dudas sobre la utilización de combos para enviar información a text box en Visual Fox Pro

Hola, mira tengo un combo que me deberia enviar la informacion a 3 texbox
osea si le doy click al combo que me envie el valor al primer combo
si le doy click de nuevo al combo y si es diferente el valor a text1 que me lo envie al text2 si es es igual al text1 que no me envie nada
si le doy un tercer click al combo y si es diferente al valor a a text1 y a text2 que me lo envie al text3 si es igual al text1 o al text2 que no me envie nada
graxxxxx
1

1 Respuesta

575 pts.
Puedes realizar la validacion en el evento valid del combo, asi:
oW = CREATEOBJECT("W")
oW.show()
READ events
DEFINE CLASS W AS Form
ADD OBJECT cmb AS combobox
ADD OBJECT txt1 AS textBox
ADD OBJECT txt2 AS textBox
ADD OBJECT txt3 AS textBox
ADD OBJECT cmd1 AS commandbutton
ADD OBJECT cmd2 AS commandbutton
PROCEDURE cmb.init
this.Left = 5
this.Top = 5
this.additem("uno")
this.additem("dos")
this.additem("tres")
ENDPROC
PROCEDURE cmb.valid
IF EMPTY(thisform.txt1.value) AND EMPTY(thisform.txt2.value) AND EMPTY(thisform.txt3.value)
thisform.txt1.value = this.value
ELSE
IF (NOT EMPTY(thisform.txt1.value) AND EMPTY(thisform.txt2.value) AND EMPTY(thisform.txt3.value)) AND thisform.txt1.value # this.value
thisform.txt2.value = this.value
ELSE
IF (NOT EMPTY(thisform.txt1.value) AND NOT EMPTY(thisform.txt2.value) AND EMPTY(thisform.txt3.value)) ;
AND thisform.txt1.value # this.value AND thisform.txt2.value # this.value AND thisform.txt3.value # this.value
thisform.txt3.value = this.value
ELSE
RETURN
ENDIF
ENDIF
ENDIF
ENDPROC
PROCEDURE txt1.init
this.Left = 5
this.Top = 35
ENDPROC
PROCEDURE txt2.init
this.Left = 5
this.Top = 65
ENDPROC
PROCEDURE txt3.init
this.Left = 5
this.Top = 95
ENDPROC
PROCEDURE cmd1.init
this.anchor = 12
this.Caption = "Salir"
this.autosize = .T.
this.Top = this.Parent.height - this.Height - 2
this.Left = this.Parent.Width - this.Width - 2
ENDPROC
PROCEDURE cmd1.click
thisform.Release()
ENDPROC
PROCEDURE cmd2.init
this.anchor = 12
this.Caption = "Limpiar"
this.autosize = .T.
this.Top = this.Parent.height - this.Height * 2 - 2
this.Left = this.Parent.Width - this.Width - 2
ENDPROC
PROCEDURE cmd2.click
thisform.txt1.value = ""
thisform.txt2.value = ""
thisform.txt3.value = ""
ENDPROC
PROCEDURE destroy
Clear events
Endproc
Enddefine

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas