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

 

 


Tema destacado: Arreglado, de nuevo, el registro del warzone (wargame) de EHN


  Mostrar Mensajes
Páginas: [1] 2
1  Sistemas Operativos / Windows / Re: Como recuperar la key de un windows 10 ? en: 10 Noviembre 2019, 09:00 am
☹ no hay modo de hacerlo mediante linea de comandos en cmd por lo que deduzco.

Gracias
2  Sistemas Operativos / Windows / Como recuperar la key de un windows 10 ? en: 9 Noviembre 2019, 08:19 am
Por cosas del destino me he visto obligado a cambiar de pc y resulta que el ssd donde tenía windows 10 ya no sera el principal sino un secundario porque en el nuevo equipo he montado m2 entonces me veo en que no se si habría alguna forma de recuperar dicha key para usarla en la nueva instalación de windows 10.

Se como hacerlo mientras estas en el propio windows 10 arrancado pero no cuando este ya no esta arrancado y pertenece a un otro ssd.

Podéis ayudarme ?
3  Programación / Programación General / Re: necesito orientación sobre programación, me ayuda alguien ? en: 31 Diciembre 2018, 18:45 pm
ostias killo, no tengo palabras la verdad, muchisimas gracias.

una consulta, el framework sustituye archivos del SO o solo añade archivos ? no se si arriesgarme la verdad en instalar el framework 2.0 o no

por otro lado en conseguido el vb6.0
4  Programación / Programación General / Re: necesito orientación sobre programación, me ayuda alguien ? en: 30 Diciembre 2018, 22:05 pm
Pues para mi resulta una putada muy grande lo que me acabas de responder. porque después de calentarme la cabeza en como solucionar los distintos problemas de la versión que ya tenia casi lista que solo faltaba pulir la un poco, porque como dije desde el comienzo de programación 0 conocimientos y no esperaba ayuda como la que me has ofrecido, pues después de ver los resultados me estaba gustando e incluso podríamos decir que me estaba sintiendo orgulloso de haber conseguido lo que ya había conseguido, ahora resulta que todo se va a la ***** por culpa del Framework. siento un cabreo y frustración internamente de la ostia.

agradezco muchísimo tu ayuda y tu ofrecimiento de hacerlo por mi, de verdad te lo digo.

lo que a continuación voy a decir es el como lo habría hecho yo.

solo que yo no habría añadido esos colores a los textbox como hiciste tu, los habría dejado en blanco y el tipo de letra arial en negrita, no habría añadido el botón que pone total y como ultimo el sonido que hace cuando cambia de textbox si se pudiera lo habría anulado ya que es algo molesto. lo otro que imagino que es por cuestiones de ir rapido, es el tema de billetes que en el de 5 € a puesto un 0 delante y en las monedas de 0,50 se te paso poner un espacio con el simbolo del €

en cuanto al detalle del icono de la calculadora no lo habría puesto ni tampoco ese titulo en el programa calculadora monetaria.... lo habría llamado como que ya has visto calculadora de la CM.


repito agradezco muchísimo tu ofrecimiento, pero claro me encuentro ahora con un programa el cual el icono de la calculadora por ejemplo se solapa con las letras de al lado y de abajo, osea que esta como puesta encima de la C de calculadora y de la B de billetes, aparte de los detalles del 0 y del €. en cuanto a tamaño creo que si que esta bien o un pelin mas grande pero no mucho mas. el cual no e podido personalizarlo yo o el adaptarlo como le podría gustar al resto de mis compañero de trabajo pero sin que se flipasen lógicamente. imagino que de hay viene mi frustración, porque no tengo derecho a unas exigencia ni nada por el estilo, ante tu detalle altruista.

el problema de no poder instalar nada, no es cuestión mía, es porque se trata del pc de donde yo trabajo, que como es tan antiguo nadie se atreve a instalar le nada no vayan a joderse el propio windows O alguno de los programas ya instalado para que funcionen los programas de la empresa. porque sino a ver quien es el lumbrera que le dice al jefe que el pc se a jodido por hacer un programa el cual llevamos haciendo los cálculos en papel hace mas de 10 años y viendo lo que cobran por arreglar ciertas cosas en mi trabajo que uno mismo diría que eso no puede costar tanto dinero no me quiero ni imaginar lo que le podría costar una re instalación del sistema operativo y los programas de nuevo. de hay viene el tema este de no poder instalar le nada.

y para resolver tu duda de la CM, CM en mi trabajo significa caja manual.

pues nada, les ofreceré a mis compañeros tu programa y quien quiera usarlo que lo use y quien no, pues nada.


nuevamente te lo digo, gracias por tu tiempo y hacer el programa.
5  Programación / Programación General / Re: necesito orientación sobre programación, me ayuda alguien ? en: 30 Diciembre 2018, 08:47 am
Hola te comento, yo uso visual estudio 2015 cree un nuevo proyecto elegi visual basic, y elegi la opcion universal de windows y luego la primera opcion, total que al form que aparece solo añadi un label y luego lo compile en x86. Para probar si asi en el pc del windows 2000 funcionaria y sigue sin ir. En cambio tu programita si que va. Con lo que me pregunto, que estoy haciendo mal en el visual studio ? O es que me tendria que buscar el visual basic 6.0 ?

aparte de eso tambien te comento otro problema que tengo.

en el visual estudio el codigo que me has puesto me salen errores por todos lados como por ejemplo diciendome de que Variant'; use el tipo 'Object' en su lugar y como ese mas cosas.

sospecho que algo estaré haciendo mal, el que ni idea.

alguna sugerencia de como arreglarlo ?

una captura de los fallos



por otro lado de ese codigo no consigo diferenciar que nombre les tengo que poner a los textbox para hacerlos coincidir con el codigo que me pusiste, para ir entendiendolo mas o menos.
6  Programación / Programación General / Re: necesito orientación sobre programación, me ayuda alguien ? en: 29 Diciembre 2018, 06:13 am
Exacto, si...
Si el ordenador destino ha de ser fijo un windows 2000, hay que rehacerlo en vb6...
No obstante, no elimines el programa... si tarde o temprano, tienes que usarlo en un equipo más actual, pués ya lo tienes.
No. Son tecnologías distintas. En windows 2000 incluso es muy probable que no admita ningún framework más actual que el 1.1 o 2.0 de NET (no estoy seguro, habría que mirarlo).
Ya en el XP, la versión superior que admite es el NET 3.5

En fin, básicamente se puede rehacer con VB6, con cambios eso sí... La cuestión es si tienes un IDE de VB6...



lo he compilado en x86 y con la versión framework.net 2.0 que es la mas baja que me permite el visual studio que yo tengo, lo probare hoy. con los resultados que obtenga te lo comentare.

después de intentar ejecutarlo me salta este error



habrá que hacerlo en visual basic finalmente ?

P.D. quiero recordar que ese ordenador no puedo instalar nada. me refiero a si me dices a mira eso instalas tal libreria de dll o lo que sea y se te soluciona. no puedo porque es el ordenador donde yo trabajo y no quiero joderla con los programas que ya maneja el propio ordenador, solo por la cosa de tener este mini programita de calculo.

7  Programación / Programación General / Re: necesito orientación sobre programación, me ayuda alguien ? en: 27 Diciembre 2018, 20:35 pm
lo que me comentas que deberia de cambiar para optimizar seria esta parte del codigo ?

Código
  1. Private Sub txtBillete50_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete50.Validating
  2.        Dim v As UShort  'UInt16 entero de 16 bits (valor en el rango: 0-65536)
  3.        ' si admite un valor negativo, cambia al tipo short (int16)
  4.  
  5.        If UShort.TryParse(txtBillete50.Text, v) = False Then
  6.            e.Cancel = True
  7.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 50'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  8.            'txtImporte50.Text ="0"
  9.        Else
  10.            txtImporte50.Text = (v * 50).ToString
  11.        End If
  12.    End Sub

y si es asi te refieres que elimine todos esos codigo y lo sustituya por el que me comentas aqui, pero claro poniendo los nombres de los billetes y monedas que corresponde en cada uno.

Código
  1. Private Sub txtMonedas001_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TxtBillete001.Validating
  2.        Call ValidandoBiletesyMonedas(sender.text, TxtImporte001, 0.1, " 'monedas de 1 céntimo'.", e)
  3.    End Sub

es que esta parte es la que no llego a comprender bien del todo, la verdad y no se si te estas refiriendo a eso o a otra cosa.

P.D. me traido el programita al pc donde se ejecutara para probarlo, y no e tenido una cosa en cuenta no se si sera una metedura de pata muy grande y tendre que comenzar desde 0 o si por el contrario seria una tonteria, el caso es que no lo e pidido ejecutar porque este pc trabaja con windows 2000 de 32 bits y el programita el exe compilado es de 64 bits.

Hay forma sencilla de arreglar eso o tendre que empezar desde 0?
8  Programación / Programación General / Re: necesito orientación sobre programación, me ayuda alguien ? en: 27 Diciembre 2018, 08:16 am
perdona no es que no me ciña a lo que me digas, es que no me di cuenta. cada vez que me dices que tengo que cambiar algo me voy fijando pero hay cosas que en el primer momento se me escapa no se porque pero lo veo igual y pienso joe pues no se donde esta la diferencia. sigo cambiando cosas y pruebo los cambios y digo esto tira, y pienso sera que hay no tenia que fijarme y yo lo e entendido mal.

bueno creo que ya esta todos los cambios aplicados

Código
  1. Public Class Form1
  2.  
  3.    Private Inicializado As Boolean
  4.  
  5.    Private Sub txtBillete50_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtBillete50.TextChanged, txtBillete20.TextChanged, txtBillete10.TextChanged, txtBillete5.TextChanged, txtMonedas2.TextChanged, txtMonedas1.TextChanged, txtMonedas050.TextChanged, txtMonedas020.TextChanged, txtMonedas010.TextChanged, txtMonedas005.TextChanged, txtMonedas002.TextChanged, txtMonedas001.TextChanged
  6.        sender.backcolor = Color.White
  7.        txtTotal.Visible = True
  8.    End Sub
  9.  
  10.    Private Sub txtBillete50_Validated(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtBillete50.Validated, txtBillete20.Validated, txtBillete10.Validated, txtBillete5.Validated, txtMonedas2.Validated, txtMonedas1.Validated, txtMonedas050.Validated, txtMonedas020.Validated, txtMonedas010.Validated, txtMonedas005.Validated, txtMonedas002.Validated, txtMonedas001.Validated
  11.        sender.backcolor = Color.White
  12.        txtTotal.Visible = True
  13.    End Sub
  14.  
  15.    Private Sub txtBillete50_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete50.Validating
  16.        Dim v As UShort  'UInt16 entero de 16 bits (valor en el rango: 0-65536)
  17.        ' si admite un valor negativo, cambia al tipo short (int16)
  18.  
  19.        If UShort.TryParse(txtBillete50.Text, v) = False Then
  20.            e.Cancel = True
  21.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 50'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  22.            'txtImporte50.Text ="0"
  23.        Else
  24.            txtImporte50.Text = (v * 50).ToString
  25.        End If
  26.    End Sub
  27.  
  28.    Private Sub txtBillete20_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete20.Validating
  29.        Dim v As UShort
  30.        If UShort.TryParse(txtBillete20.Text, v) = False Then
  31.            e.Cancel = True
  32.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 20'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  33.        Else
  34.            txtImporte20.Text = (v * 20).ToString
  35.        End If
  36.    End Sub
  37.  
  38.    Private Sub txtBillete10_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete10.Validating
  39.        Dim v As UShort
  40.        If UShort.TryParse(txtBillete10.Text, v) = False Then
  41.            e.Cancel = True
  42.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 10'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  43.        Else
  44.            txtImporte10.Text = (v * 10).ToString
  45.        End If
  46.    End Sub
  47.  
  48.    Private Sub txtBillete5_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete5.Validating
  49.        Dim v As UShort
  50.        If UShort.TryParse(txtBillete5.Text, v) = False Then
  51.            e.Cancel = True
  52.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 5'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  53.        Else
  54.            txtImporte5.Text = (v * 5).ToString
  55.        End If
  56.    End Sub
  57.  
  58.    Private Sub txtMonedas2_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas2.Validating
  59.        Dim v As UShort
  60.        If UShort.TryParse(txtMonedas2.Text, v) = False Then
  61.            e.Cancel = True
  62.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 2'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  63.        Else
  64.            txtImporte2.Text = (v * 2).ToString
  65.        End If
  66.    End Sub
  67.  
  68.    Private Sub txtMonedas1_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas1.Validating
  69.        Dim v As UShort
  70.        If UShort.TryParse(txtMonedas1.Text, v) = False Then
  71.            e.Cancel = True
  72.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 1'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  73.        Else
  74.            txtImporte1.Text = (v * 1).ToString
  75.        End If
  76.    End Sub
  77.  
  78.    Private Sub txtMonedas050_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas050.Validating
  79.        Dim v As UShort
  80.        If UShort.TryParse(txtMonedas050.Text, v) = False Then
  81.            e.Cancel = True
  82.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 0.50'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  83.        Else
  84.            txtImporte050.Text = (0.5 * v).ToString
  85.        End If
  86.    End Sub
  87.  
  88.    Private Sub txtMonedas020_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas020.Validating
  89.        Dim v As UShort
  90.        If UShort.TryParse(txtMonedas020.Text, v) = False Then
  91.            e.Cancel = True
  92.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 0.20'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  93.        Else
  94.            txtImporte020.Text = (0.2 * v).ToString
  95.        End If
  96.    End Sub
  97.  
  98.    Private Sub txtMonedas010_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas010.Validating
  99.        Dim v As UShort
  100.        If UShort.TryParse(txtMonedas010.Text, v) = False Then
  101.            e.Cancel = True
  102.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 0.10'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  103.        Else
  104.            txtImporte010.Text = (0.1 * v).ToString
  105.        End If
  106.    End Sub
  107.  
  108.    Private Sub txtMonedas005_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas005.Validating
  109.        Dim v As UShort
  110.        If UShort.TryParse(txtMonedas005.Text, v) = False Then
  111.            e.Cancel = True
  112.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 0.05'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  113.        Else
  114.            txtImporte005.Text = (0.05 * v).ToString
  115.        End If
  116.    End Sub
  117.  
  118.    Private Sub txtMonedas002_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas002.Validating
  119.        Dim v As UShort
  120.        If UShort.TryParse(txtMonedas002.Text, v) = False Then
  121.            e.Cancel = True
  122.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 0.02'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  123.        Else
  124.            txtImporte002.Text = (0.02 * v).ToString
  125.        End If
  126.    End Sub
  127.  
  128.    Private Sub txtMonedas001_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas001.Validating
  129.        Dim v As UShort
  130.        If UShort.TryParse(txtMonedas001.Text, v) = False Then
  131.            e.Cancel = True
  132.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 0.01'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  133.        Else
  134.            txtImporte001.Text = (0.01 * v).ToString
  135.        End If
  136.    End Sub
  137.    Private Sub Totalizar() Handles txtImporte50.TextChanged, txtImporte20.TextChanged, txtImporte10.TextChanged, txtImporte5.TextChanged, txtImporte2.TextChanged, txtImporte1.TextChanged, txtImporte050.TextChanged, txtImporte020.TextChanged, txtImporte010.TextChanged, txtImporte005.TextChanged, txtImporte002.TextChanged, txtImporte001.TextChanged
  138.        Dim CantidadTotal As Single  ' entero de 32 bits...
  139.  
  140.        If (Inicializado = True) Then
  141.            CantidadTotal = 0
  142.            CantidadTotal += Single.Parse(txtImporte50.Text)
  143.            CantidadTotal += Single.Parse(txtImporte20.Text)
  144.            CantidadTotal += Single.Parse(txtImporte10.Text)
  145.            CantidadTotal += Single.Parse(txtImporte5.Text)
  146.            CantidadTotal += Single.Parse(txtImporte2.Text)
  147.            CantidadTotal += Single.Parse(txtImporte1.Text)
  148.            CantidadTotal += Single.Parse(txtImporte050.Text)
  149.            CantidadTotal += Single.Parse(txtImporte020.Text)
  150.            CantidadTotal += Single.Parse(txtImporte010.Text)
  151.            CantidadTotal += Single.Parse(txtImporte005.Text)
  152.            CantidadTotal += Single.Parse(txtImporte002.Text)
  153.            CantidadTotal += Single.Parse(txtImporte001.Text)
  154.  
  155.            txtTotal.Text = CantidadTotal.ToString
  156.        End If
  157.    End Sub
  158.  
  159.    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  160.        Inicializado = True
  161.    End Sub
  162.  
  163.    Private Sub txtBillete50_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBillete50.KeyPress
  164.        If Asc(e.KeyChar) = 13 Then
  165.            txtBillete20.Focus()
  166.            e.Handled = True
  167.        End If
  168.    End Sub
  169.  
  170.    Private Sub txtBillete20_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBillete20.KeyPress
  171.        If Asc(e.KeyChar) = 13 Then
  172.            txtBillete10.Focus()
  173.            e.Handled = True
  174.        End If
  175.    End Sub
  176.  
  177.    Private Sub txtBillete10_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBillete10.KeyPress
  178.        If Asc(e.KeyChar) = 13 Then
  179.            txtBillete5.Focus()
  180.            e.Handled = True
  181.        End If
  182.    End Sub
  183.  
  184.    Private Sub txtBillete5_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBillete5.KeyPress
  185.        If Asc(e.KeyChar) = 13 Then
  186.            txtMonedas2.Focus()
  187.            e.Handled = True
  188.        End If
  189.    End Sub
  190.  
  191.    Private Sub txtMonedas2_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas2.KeyPress
  192.        If Asc(e.KeyChar) = 13 Then
  193.            txtMonedas1.Focus()
  194.            e.Handled = True
  195.        End If
  196.    End Sub
  197.    Private Sub txtMonedas1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas1.KeyPress
  198.        If Asc(e.KeyChar) = 13 Then
  199.            txtMonedas050.Focus()
  200.            e.Handled = True
  201.        End If
  202.    End Sub
  203.  
  204.    Private Sub txtMonedas050_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas050.KeyPress
  205.        If Asc(e.KeyChar) = 13 Then
  206.            txtMonedas020.Focus()
  207.            e.Handled = True
  208.        End If
  209.    End Sub
  210.  
  211.    Private Sub txtMonedas020_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas020.KeyPress
  212.        If Asc(e.KeyChar) = 13 Then
  213.            txtMonedas010.Focus()
  214.            e.Handled = True
  215.        End If
  216.    End Sub
  217.  
  218.    Private Sub txtMonedas010_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas010.KeyPress
  219.        If Asc(e.KeyChar) = 13 Then
  220.            txtMonedas005.Focus()
  221.            e.Handled = True
  222.        End If
  223.    End Sub
  224.  
  225.    Private Sub txtMonedas005_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas005.KeyPress
  226.        If Asc(e.KeyChar) = 13 Then
  227.            txtMonedas002.Focus()
  228.            e.Handled = True
  229.        End If
  230.    End Sub
  231.  
  232.    Private Sub txtMonedas002_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas002.KeyPress
  233.        If Asc(e.KeyChar) = 13 Then
  234.            txtMonedas001.Focus()
  235.            e.Handled = True
  236.        End If
  237.    End Sub
  238.    Private Sub txtMonedas001_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas001.KeyPress
  239.        If Asc(e.KeyChar) = 13 Then
  240.            txtTotal1.Focus()
  241.            e.Handled = True
  242.        End If
  243.    End Sub
  244.  
  245. End Class
  246.  
9  Programación / Programación General / Re: necesito orientación sobre programación, me ayuda alguien ? en: 26 Diciembre 2018, 22:20 pm
vale he hecho los cambios que me has comentado, pero te comento que he encontrado un fallo el cual no se a que se debe. imagino que habrá que programarlo también. es el hecho en que si por ejemplo en los billetes de 50 pones 4 el resultado sera 200 y en la totalización dará 200, pero cuando llegas al billete de 5 y si en un principio pones que hay 5 que serian 25 el resultado en la totalización serian 225, pero si borras los 5 porque eran 6 el resultado te lo da que serian 30 pero en la suma no se efectúa dicho cambio en la operación, no se si me explico.

esta observación la veo que pasa a partir de los billete de 5

https://www.justbeamit.com/zk7mk

Código
  1. Public Class Form1
  2.  
  3.    Private Inicializado As Boolean
  4.  
  5.    Private Sub txtBillete50_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtBillete50.TextChanged, txtBillete20.TextChanged, txtBillete10.TextChanged, txtBillete5.TextChanged, txtMonedas2.TextChanged, txtMonedas1.TextChanged, txtMonedas050.TextChanged, txtMonedas020.TextChanged, txtMonedas010.TextChanged, txtMonedas005.TextChanged, txtMonedas002.TextChanged, txtMonedas001.TextChanged
  6.        sender.backcolor = Color.White
  7.        txtTotal.Visible = True
  8.    End Sub
  9.  
  10.    Private Sub txtBillete50_Validated(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtBillete50.Validated, txtBillete20.Validated, txtBillete10.Validated, txtBillete5.Validated, txtMonedas2.Validated, txtMonedas1.Validated, txtMonedas050.Validated, txtMonedas020.Validated, txtMonedas010.Validated, txtMonedas005.Validated, txtMonedas002.Validated, txtMonedas001.Validated
  11.        sender.backcolor = Color.White
  12.        txtTotal.Visible = True
  13.    End Sub
  14.  
  15.    Private Sub txtBillete50_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete50.Validating
  16.        Dim v As UShort  'UInt16 entero de 16 bits (valor en el rango: 0-65536)
  17.        ' si admite un valor negativo, cambia al tipo short (int16)
  18.  
  19.        If UShort.TryParse(txtBillete50.Text, v) = False Then
  20.            e.Cancel = True
  21.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 50'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  22.            'txtImporte50.Text ="0"
  23.        Else
  24.            txtImporte50.Text = (v * 50).ToString
  25.        End If
  26.    End Sub
  27.  
  28.    Private Sub txtBillete20_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete20.Validating
  29.        Dim v As UShort
  30.        If UShort.TryParse(txtBillete20.Text, v) = False Then
  31.            e.Cancel = True
  32.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 20'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  33.        Else
  34.            txtImporte20.Text = (v * 20).ToString
  35.        End If
  36.    End Sub
  37.  
  38.    Private Sub txtBillete10_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete10.Validating
  39.        Dim v As UShort
  40.        If UShort.TryParse(txtBillete10.Text, v) = False Then
  41.            e.Cancel = True
  42.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 10'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  43.        Else
  44.            txtImporte10.Text = (v * 10).ToString
  45.        End If
  46.    End Sub
  47.  
  48.    Private Sub txtBillete5_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete5.Validating
  49.        Dim v As UShort
  50.        If UShort.TryParse(txtBillete5.Text, v) = False Then
  51.            e.Cancel = True
  52.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 5'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  53.        Else
  54.            txtImporte5.Text = (v * 5).ToString
  55.        End If
  56.    End Sub
  57.  
  58.    Private Sub txtMonedas2_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas2.Validating
  59.        Dim v As UShort
  60.        If UShort.TryParse(txtMonedas2.Text, v) = False Then
  61.            e.Cancel = True
  62.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 2'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  63.        Else
  64.            txtImporte2.Text = (v * 2).ToString
  65.        End If
  66.    End Sub
  67.  
  68.    Private Sub txtMonedas1_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas1.Validating
  69.        Dim v As UShort
  70.        If UShort.TryParse(txtMonedas1.Text, v) = False Then
  71.            e.Cancel = True
  72.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 1'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  73.        Else
  74.            txtImporte1.Text = (v * 1).ToString
  75.        End If
  76.    End Sub
  77.  
  78.    Private Sub txtMonedas050_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas050.Validating
  79.        Dim v As UShort
  80.        If UShort.TryParse(txtMonedas050.Text, v) = False Then
  81.            e.Cancel = True
  82.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 0.50'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  83.        Else
  84.            txtImporte050.Text = (0.5 * v).ToString
  85.        End If
  86.    End Sub
  87.  
  88.    Private Sub txtMonedas020_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas020.Validating
  89.        Dim v As UShort
  90.        If UShort.TryParse(txtMonedas020.Text, v) = False Then
  91.            e.Cancel = True
  92.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 0.20'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  93.        Else
  94.            txtImporte020.Text = (0.2 * v).ToString
  95.        End If
  96.    End Sub
  97.  
  98.    Private Sub txtMonedas010_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas010.Validating
  99.        Dim v As UShort
  100.        If UShort.TryParse(txtMonedas010.Text, v) = False Then
  101.            e.Cancel = True
  102.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 0.10'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  103.        Else
  104.            txtImporte010.Text = (0.1 * v).ToString
  105.        End If
  106.    End Sub
  107.  
  108.    Private Sub txtMonedas005_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas005.Validating
  109.        Dim v As UShort
  110.        If UShort.TryParse(txtMonedas005.Text, v) = False Then
  111.            e.Cancel = True
  112.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 0.05'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  113.        Else
  114.            txtImporte005.Text = (0.05 * v).ToString
  115.        End If
  116.    End Sub
  117.  
  118.    Private Sub txtMonedas002_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas002.Validating
  119.        Dim v As UShort
  120.        If UShort.TryParse(txtMonedas002.Text, v) = False Then
  121.            e.Cancel = True
  122.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 0.02'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  123.        Else
  124.            txtImporte002.Text = (0.02 * v).ToString
  125.        End If
  126.    End Sub
  127.  
  128.    Private Sub txtMonedas001_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas001.Validating
  129.        Dim v As UShort
  130.        If UShort.TryParse(txtMonedas001.Text, v) = False Then
  131.            e.Cancel = True
  132.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 0.01'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  133.        Else
  134.            txtImporte001.Text = (0.01 * v).ToString
  135.        End If
  136.    End Sub
  137.    Private Sub Totalizar() Handles txtBillete50.TextChanged, txtBillete20.TextChanged, txtBillete10.TextChanged, txtBillete5.TextChanged, txtMonedas2.TextChanged, txtMonedas1.TextChanged, txtMonedas050.TextChanged, txtMonedas020.TextChanged, txtMonedas010.TextChanged, txtMonedas005.TextChanged, txtMonedas002.TextChanged, txtMonedas001.TextChanged
  138.        Dim CantidadTotal As Single  ' entero de 32 bits...
  139.  
  140.        If (Inicializado = True) Then
  141.            CantidadTotal = 0
  142.            CantidadTotal += Single.Parse(txtImporte50.Text)
  143.            CantidadTotal += Single.Parse(txtImporte20.Text)
  144.            CantidadTotal += Single.Parse(txtImporte10.Text)
  145.            CantidadTotal += Single.Parse(txtImporte5.Text)
  146.            CantidadTotal += Single.Parse(txtImporte2.Text)
  147.            CantidadTotal += Single.Parse(txtImporte1.Text)
  148.            CantidadTotal += Single.Parse(txtImporte050.Text)
  149.            CantidadTotal += Single.Parse(txtImporte020.Text)
  150.            CantidadTotal += Single.Parse(txtImporte010.Text)
  151.            CantidadTotal += Single.Parse(txtImporte005.Text)
  152.            CantidadTotal += Single.Parse(txtImporte002.Text)
  153.            CantidadTotal += Single.Parse(txtImporte001.Text)
  154.  
  155.            txtTotal.Text = CantidadTotal.ToString
  156.        End If
  157.    End Sub
  158.  
  159.  
  160.  
  161.    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  162.        Inicializado = True
  163.    End Sub
  164.  
  165.    Private Sub txtBillete50_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBillete50.KeyPress
  166.        If Asc(e.KeyChar) = 13 Then
  167.            txtBillete20.Focus()
  168.            e.Handled = True
  169.        End If
  170.    End Sub
  171.  
  172.    Private Sub txtBillete20_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBillete20.KeyPress
  173.        If Asc(e.KeyChar) = 13 Then
  174.            txtBillete10.Focus()
  175.            e.Handled = True
  176.        End If
  177.    End Sub
  178.  
  179.    Private Sub txtBillete10_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBillete10.KeyPress
  180.        If Asc(e.KeyChar) = 13 Then
  181.            txtBillete5.Focus()
  182.            e.Handled = True
  183.        End If
  184.    End Sub
  185.  
  186.    Private Sub txtBillete5_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBillete5.KeyPress
  187.        If Asc(e.KeyChar) = 13 Then
  188.            txtMonedas2.Focus()
  189.            e.Handled = True
  190.        End If
  191.    End Sub
  192.  
  193.    Private Sub txtMonedas2_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas2.KeyPress
  194.        If Asc(e.KeyChar) = 13 Then
  195.            txtMonedas1.Focus()
  196.            e.Handled = True
  197.        End If
  198.    End Sub
  199.    Private Sub txtMonedas1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas1.KeyPress
  200.        If Asc(e.KeyChar) = 13 Then
  201.            txtMonedas050.Focus()
  202.            e.Handled = True
  203.        End If
  204.    End Sub
  205.  
  206.    Private Sub txtMonedas050_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas050.KeyPress
  207.        If Asc(e.KeyChar) = 13 Then
  208.            txtMonedas020.Focus()
  209.            e.Handled = True
  210.        End If
  211.    End Sub
  212.  
  213.    Private Sub txtMonedas020_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas020.KeyPress
  214.        If Asc(e.KeyChar) = 13 Then
  215.            txtMonedas010.Focus()
  216.            e.Handled = True
  217.        End If
  218.    End Sub
  219.  
  220.    Private Sub txtMonedas010_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas010.KeyPress
  221.        If Asc(e.KeyChar) = 13 Then
  222.            txtMonedas005.Focus()
  223.            e.Handled = True
  224.        End If
  225.    End Sub
  226.  
  227.    Private Sub txtMonedas005_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas005.KeyPress
  228.        If Asc(e.KeyChar) = 13 Then
  229.            txtMonedas002.Focus()
  230.            e.Handled = True
  231.        End If
  232.    End Sub
  233.  
  234.    Private Sub txtMonedas002_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas002.KeyPress
  235.        If Asc(e.KeyChar) = 13 Then
  236.            txtMonedas001.Focus()
  237.            e.Handled = True
  238.        End If
  239.    End Sub
  240.    Private Sub txtMonedas001_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas001.KeyPress
  241.        If Asc(e.KeyChar) = 13 Then
  242.            txtTotal1.Focus()
  243.            e.Handled = True
  244.        End If
  245.    End Sub
  246.    Private Sub Totalizar(sender As Object, e As EventArgs) Handles txtBillete50.TextChanged, txtBillete20.TextChanged, txtBillete10.TextChanged, txtBillete5.TextChanged, txtMonedas2.TextChanged, txtMonedas1.TextChanged, txtMonedas050.TextChanged, txtMonedas020.TextChanged, txtMonedas010.TextChanged, txtMonedas005.TextChanged, txtMonedas002.TextChanged, txtMonedas001.TextChanged
  247.  
  248.    End Sub
  249.  
  250. End Class
10  Programación / Programación General / Re: necesito orientación sobre programación, me ayuda alguien ? en: 25 Diciembre 2018, 23:42 pm
vale despues de muchos intentos y demas movidas ya lo tengo conseguido a continuacion el codigo y la aplicacion

https://www.justbeamit.com/tgk55

Código
  1. Public Class Form1
  2.  
  3.    Private Inicializado As Boolean
  4.  
  5.    Private Sub txtBillete50_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtBillete50.TextChanged, txtBillete20.TextChanged, txtBillete10.TextChanged, txtBillete5.TextChanged, txtMonedas2.TextChanged, txtMonedas1.TextChanged, txtMonedas050.TextChanged, txtMonedas020.TextChanged, txtMonedas010.TextChanged, txtMonedas005.TextChanged, txtMonedas002.TextChanged, txtMonedas001.TextChanged
  6.        sender.backcolor = Color.White
  7.        txtTotal.Visible = True
  8.    End Sub
  9.  
  10.    Private Sub txtBillete50_Validated(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtBillete50.Validated, txtBillete20.Validated, txtBillete10.Validated, txtBillete5.Validated, txtMonedas2.Validated, txtMonedas1.Validated, txtMonedas050.Validated, txtMonedas020.Validated, txtMonedas010.Validated, txtMonedas005.Validated, txtMonedas002.Validated, txtMonedas001.Validated
  11.        sender.backcolor = Color.White
  12.        txtTotal.Visible = True
  13.    End Sub
  14.  
  15.    Private Sub txtBillete50_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete50.Validating
  16.        Dim v As UShort  'UInt16 entero de 16 bits (valor en el rango: 0-65536)
  17.        ' si admite un valor negativo, cambia al tipo short (int16)
  18.  
  19.        If UShort.TryParse(txtBillete50.Text, v) = False Then
  20.            e.Cancel = True
  21.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 50'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  22.            'txtImporte50.Text ="0"
  23.        Else
  24.            txtImporte50.Text = (v * 50).ToString
  25.        End If
  26.    End Sub
  27.  
  28.    Private Sub txtBillete20_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete20.Validating
  29.        Dim v As UShort
  30.        If UShort.TryParse(txtBillete20.Text, v) = False Then
  31.            e.Cancel = True
  32.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 20'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  33.        Else
  34.            txtImporte20.Text = (v * 20).ToString
  35.        End If
  36.    End Sub
  37.  
  38.    Private Sub txtBillete10_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete10.Validating
  39.        Dim v As UShort
  40.        If UShort.TryParse(txtBillete10.Text, v) = False Then
  41.            e.Cancel = True
  42.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 10'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  43.        Else
  44.            txtImporte10.Text = (v * 10).ToString
  45.        End If
  46.    End Sub
  47.  
  48.    Private Sub txtBillete5_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete5.Validating
  49.        Dim v As UShort
  50.        If UShort.TryParse(txtBillete5.Text, v) = False Then
  51.            e.Cancel = True
  52.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 5'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  53.        Else
  54.            txtImporte5.Text = (v * 5).ToString
  55.        End If
  56.    End Sub
  57.  
  58.    Private Sub txtMonedas2_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas2.Validating
  59.        Dim v As UShort
  60.        If UShort.TryParse(txtMonedas2.Text, v) = False Then
  61.            e.Cancel = True
  62.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 2'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  63.        Else
  64.            txtImporte2.Text = (v * 2).ToString
  65.        End If
  66.    End Sub
  67.  
  68.    Private Sub txtMonedas1_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas1.Validating
  69.        Dim v As UShort
  70.        If UShort.TryParse(txtMonedas1.Text, v) = False Then
  71.            e.Cancel = True
  72.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 1'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  73.        Else
  74.            txtImporte1.Text = (v * 1).ToString
  75.        End If
  76.    End Sub
  77.  
  78.    Private Sub txtMonedas050_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas050.Validating
  79.        Dim v As Single
  80.        If Single.TryParse(txtMonedas050.Text, v) = False Then
  81.            e.Cancel = True
  82.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 0.50'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  83.        Else
  84.            txtImporte050.Text = (v * 0.5).ToString
  85.        End If
  86.    End Sub
  87.  
  88.    Private Sub txtMonedas020_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas020.Validating
  89.        Dim v As Single
  90.        If Single.TryParse(txtMonedas020.Text, v) = False Then
  91.            e.Cancel = True
  92.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 0.20'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  93.        Else
  94.            txtImporte020.Text = (v * 0.2).ToString
  95.        End If
  96.    End Sub
  97.  
  98.    Private Sub txtMonedas010_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas010.Validating
  99.        Dim v As Single
  100.        If Single.TryParse(txtMonedas010.Text, v) = False Then
  101.            e.Cancel = True
  102.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 0.10'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  103.        Else
  104.            txtImporte010.Text = (v * 0.1).ToString
  105.        End If
  106.    End Sub
  107.  
  108.    Private Sub txtMonedas005_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas005.Validating
  109.        Dim v As Single
  110.        If Single.TryParse(txtMonedas005.Text, v) = False Then
  111.            e.Cancel = True
  112.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 0.05'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  113.        Else
  114.            txtImporte005.Text = (v * 0.05).ToString
  115.        End If
  116.    End Sub
  117.  
  118.    Private Sub txtMonedas002_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas002.Validating
  119.        Dim v As Single
  120.        If Single.TryParse(txtMonedas002.Text, v) = False Then
  121.            e.Cancel = True
  122.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 0.02'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  123.        Else
  124.            txtImporte002.Text = (v * 0.02).ToString
  125.        End If
  126.    End Sub
  127.  
  128.    Private Sub txtMonedas001_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas001.Validating
  129.        Dim v As Single
  130.        If Single.TryParse(txtMonedas001.Text, v) = False Then
  131.            e.Cancel = True
  132.            Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 0.01'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning)
  133.        Else
  134.            txtImporte001.Text = (v * 0.01).ToString
  135.        End If
  136.    End Sub
  137.    Private Sub Totalizar() Handles txtImporte50.TextChanged, txtImporte20.TextChanged, txtImporte10.TextChanged
  138.        Dim CantidadTotal As Single  ' entero de 32 bits...
  139.  
  140.        If (Inicializado = True) Then
  141.            CantidadTotal = 0
  142.            CantidadTotal += Single.Parse(txtImporte50.Text)
  143.            CantidadTotal += Single.Parse(txtImporte20.Text)
  144.            CantidadTotal += Single.Parse(txtImporte10.Text)
  145.            CantidadTotal += Single.Parse(txtImporte5.Text)
  146.            CantidadTotal += Single.Parse(txtImporte2.Text)
  147.            CantidadTotal += Single.Parse(txtImporte1.Text)
  148.            CantidadTotal += Single.Parse(txtImporte050.Text)
  149.            CantidadTotal += Single.Parse(txtImporte020.Text)
  150.            CantidadTotal += Single.Parse(txtImporte010.Text)
  151.            CantidadTotal += Single.Parse(txtImporte005.Text)
  152.            CantidadTotal += Single.Parse(txtImporte002.Text)
  153.            CantidadTotal += Single.Parse(txtImporte001.Text)
  154.  
  155.            txtTotal.Text = CantidadTotal.ToString
  156.        End If
  157.    End Sub
  158.  
  159.  
  160.  
  161.    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  162.        Inicializado = True
  163.    End Sub
  164.  
  165.    Private Sub txtBillete50_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBillete50.KeyPress
  166.        If Asc(e.KeyChar) = 13 Then
  167.            txtBillete20.Focus()
  168.            e.Handled = True
  169.        End If
  170.    End Sub
  171.  
  172.    Private Sub txtBillete20_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBillete20.KeyPress
  173.        If Asc(e.KeyChar) = 13 Then
  174.            txtBillete10.Focus()
  175.            e.Handled = True
  176.        End If
  177.    End Sub
  178.  
  179.    Private Sub txtBillete10_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBillete10.KeyPress
  180.        If Asc(e.KeyChar) = 13 Then
  181.            txtBillete5.Focus()
  182.            e.Handled = True
  183.        End If
  184.    End Sub
  185.  
  186.    Private Sub txtBillete5_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBillete5.KeyPress
  187.        If Asc(e.KeyChar) = 13 Then
  188.            txtMonedas2.Focus()
  189.            e.Handled = True
  190.        End If
  191.    End Sub
  192.  
  193.    Private Sub txtMonedas2_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas2.KeyPress
  194.        If Asc(e.KeyChar) = 13 Then
  195.            txtMonedas1.Focus()
  196.            e.Handled = True
  197.        End If
  198.    End Sub
  199.    Private Sub txtMonedas1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas1.KeyPress
  200.        If Asc(e.KeyChar) = 13 Then
  201.            txtMonedas050.Focus()
  202.            e.Handled = True
  203.        End If
  204.    End Sub
  205.  
  206.    Private Sub txtMonedas050_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas050.KeyPress
  207.        If Asc(e.KeyChar) = 13 Then
  208.            txtMonedas020.Focus()
  209.            e.Handled = True
  210.        End If
  211.    End Sub
  212.  
  213.    Private Sub txtMonedas020_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas020.KeyPress
  214.        If Asc(e.KeyChar) = 13 Then
  215.            txtMonedas010.Focus()
  216.            e.Handled = True
  217.        End If
  218.    End Sub
  219.  
  220.    Private Sub txtMonedas010_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas010.KeyPress
  221.        If Asc(e.KeyChar) = 13 Then
  222.            txtMonedas005.Focus()
  223.            e.Handled = True
  224.        End If
  225.    End Sub
  226.  
  227.    Private Sub txtMonedas005_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas005.KeyPress
  228.        If Asc(e.KeyChar) = 13 Then
  229.            txtMonedas002.Focus()
  230.            e.Handled = True
  231.        End If
  232.    End Sub
  233.  
  234.    Private Sub txtMonedas002_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas002.KeyPress
  235.        If Asc(e.KeyChar) = 13 Then
  236.            txtMonedas001.Focus()
  237.            e.Handled = True
  238.        End If
  239.    End Sub
  240.    Private Sub txtMonedas001_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas001.KeyPress
  241.        If Asc(e.KeyChar) = 13 Then
  242.            txtTotal1.Focus()
  243.            e.Handled = True
  244.        End If
  245.    End Sub
  246.    Private Sub Totalizar(sender As Object, e As EventArgs) Handles txtImporte50.TextChanged, txtImporte20.TextChanged, txtImporte10.TextChanged
  247.  
  248.    End Sub
  249. End Class
  250.  

gracias por la ayuda de verdad os los digo.

El unico problemilla que me encuentro es que el icono no se aplicar en la ventana del propio programilla, solo se aplica al ejecutable y no se el porque. pero bueno lo que queria hacer ya esta hecho, nuevamente muchas gracias
Páginas: [1] 2
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines