elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Guía rápida para descarga de herramientas gratuitas de seguridad y desinfección


  Mostrar Mensajes
Páginas: 1 2 [3]
21  Programación / Programación Visual Basic / Re: crear un contador a partir de una condicion.??? en: 2 Julio 2009, 00:35 am
ok supongamos q lo haga con select case
tu dices q

txt2.Text = 5000 + 100 * (3000 - text1) / 100)

supongamos q text1=3001
segun tu formula  seria (arreglando la parte  3000 - text1 por text1-3000 para q no de negativo)
txt2.Text = 5000 + 100 * (3001 -3000) / 100)
txt2.Text = 5000 + 100 * (1) / 100)
txt2.text = 5000 + 1
txt2.text = 5001    

y segun los requerimientos q mencione arriba...  cuando txt1 es mayor de 3000 se le suman 5000+100 por cada 100

o sea que si txt1=3001 entonces txt2 deberia ser igual a 5100
22  Programación / Programación Visual Basic / crear un contador a partir de una condicion.??? en: 1 Julio 2009, 23:26 pm
Necesito mostrar en una caja de texto un numero pero con esta condicion
text2 es un valor de la tabla que esta abajo....

Código:
Private Sub cmdcalcularu_Click()
If (txt1.Text = 0) Then
MsgBox "Debe ser un número mayor que cero", 48, "Atencion"
txt1.Text = ""
txt1.SetFocus
 Else
  If (txt1.Text <= 200) Then
  txt2.Text = 1500
   Else
    If (txt1.Text >= 201) And (txt1.Text <= 300) Then
    txt2.Text = 1700
    txt1.SetFocus
     Else
      If (txt1.Text >= 301) And (txt1.Text <= 400) Then
      txt2.Text = 1900
      txt1.SetFocus
       Else
        If (txt1.Text >= 401) And (txt1.Text <= 500) Then
        txt2.Text = 2100
        txt1.SetFocus
         Else
          If (txt1.Text >= 501) And (txt1.Text <= 600) Then
          txt2.Text = 2200
          txt1.SetFocus
           Else
            If (txt1.Text >= 601) And (txt1.Text <= 700) Then
            txt2.Text = 2300
            txt1.SetFocus
             Else
              If (txt1.Text >= 701) And (txt1.Text <= 800) Then
              txt2.Text = 2400
              txt1.SetFocus
               Else
                If (txt1.Text >= 801) And (txt1.Text <= 900) Then
                txt2.Text = 2500
                txt1.SetFocus
                 Else
                  If (txt1.Text >= 901) And (txt1.Text <= 1000) Then
                  txt2.Text = 2600
                  txt1.SetFocus
                   Else
                    If (txt1.Text >= 1001) And (txt1.Text <= 1200) Then
                    txt2.Text = 2800
                    txt1.SetFocus
                     Else
                      If (txt1.Text >= 1201) And (txt1.Text <= 1400) Then
                      txt2.Text = 3000
                      txt1.SetFocus
                       Else
                        If (txt1.Text >= 1401) And (txt1.Text <= 1700) Then
                        txt2.Text = 3400
                        txt1.SetFocus
                         Else
                          If (txt1.Text >= 1701) And (txt1.Text <= 2000) Then
                          txt2.Text = 3800
                          txt1.SetFocus
                           Else
                            If (txt1.Text >= 2001) And (txt1.Text <= 2500) Then
                            txt2.Text = 4500
                            txt1.SetFocus
                             Else
                              If (txt1.Text >= 2501) And (txt1.Text <= 3000) Then
                              txt2.Text = 5000
                              txt1.SetFocus
End Sub

ahora despues de eso necesito que cuando txt1 sea mayor que 3000 al txt2 sea
con la condicion que se me muestra en la siguiente tabla donde txt1 es el area total de la parcela y txt2 la dotacion total de agua correspondient e en 1 dia
aqui esta la imagen de la tabla
http://img189.imageshack.us/i/tablak.jpg/

PD: en el code no he cerrado los if con sus respectivos End If

Páginas: 1 2 [3]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines