|
Mostrar Mensajes
|
Páginas: [1] 2
|
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 ?
|
|
|
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 ? Private Sub txtBillete50_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete50.Validating Dim v As UShort 'UInt16 entero de 16 bits (valor en el rango: 0-65536) ' si admite un valor negativo, cambia al tipo short (int16) If UShort.TryParse(txtBillete50.Text, v) = False Then e.Cancel = True Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 50'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning) 'txtImporte50.Text ="0" Else txtImporte50.Text = (v * 50).ToString End If 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. Private Sub txtMonedas001_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles TxtBillete001.Validating Call ValidandoBiletesyMonedas(sender.text, TxtImporte001, 0.1, " 'monedas de 1 céntimo'.", e) 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 Public Class Form1 Private Inicializado As Boolean 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 sender.backcolor = Color.White txtTotal.Visible = True End Sub 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 sender.backcolor = Color.White txtTotal.Visible = True End Sub Private Sub txtBillete50_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete50.Validating Dim v As UShort 'UInt16 entero de 16 bits (valor en el rango: 0-65536) ' si admite un valor negativo, cambia al tipo short (int16) If UShort.TryParse(txtBillete50.Text, v) = False Then e.Cancel = True Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 50'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning) 'txtImporte50.Text ="0" Else txtImporte50.Text = (v * 50).ToString End If End Sub Private Sub txtBillete20_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete20.Validating Dim v As UShort If UShort.TryParse(txtBillete20.Text, v) = False Then e.Cancel = True Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 20'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning) Else txtImporte20.Text = (v * 20).ToString End If End Sub Private Sub txtBillete10_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete10.Validating Dim v As UShort If UShort.TryParse(txtBillete10.Text, v) = False Then e.Cancel = True Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 10'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning) Else txtImporte10.Text = (v * 10).ToString End If End Sub Private Sub txtBillete5_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete5.Validating Dim v As UShort If UShort.TryParse(txtBillete5.Text, v) = False Then e.Cancel = True Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 5'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning) Else txtImporte5.Text = (v * 5).ToString End If End Sub Private Sub txtMonedas2_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas2.Validating Dim v As UShort If UShort.TryParse(txtMonedas2.Text, v) = False Then e.Cancel = True Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 2'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning) Else txtImporte2.Text = (v * 2).ToString End If End Sub Private Sub txtMonedas1_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas1.Validating Dim v As UShort If UShort.TryParse(txtMonedas1.Text, v) = False Then e.Cancel = True Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 1'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning) Else txtImporte1.Text = (v * 1).ToString End If End Sub Private Sub txtMonedas050_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas050.Validating Dim v As UShort If UShort.TryParse(txtMonedas050.Text, v) = False Then e.Cancel = True 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) Else txtImporte050.Text = (0.5 * v).ToString End If End Sub Private Sub txtMonedas020_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas020.Validating Dim v As UShort If UShort.TryParse(txtMonedas020.Text, v) = False Then e.Cancel = True 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) Else txtImporte020.Text = (0.2 * v).ToString End If End Sub Private Sub txtMonedas010_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas010.Validating Dim v As UShort If UShort.TryParse(txtMonedas010.Text, v) = False Then e.Cancel = True 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) Else txtImporte010.Text = (0.1 * v).ToString End If End Sub Private Sub txtMonedas005_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas005.Validating Dim v As UShort If UShort.TryParse(txtMonedas005.Text, v) = False Then e.Cancel = True 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) Else txtImporte005.Text = (0.05 * v).ToString End If End Sub Private Sub txtMonedas002_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas002.Validating Dim v As UShort If UShort.TryParse(txtMonedas002.Text, v) = False Then e.Cancel = True 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) Else txtImporte002.Text = (0.02 * v).ToString End If End Sub Private Sub txtMonedas001_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas001.Validating Dim v As UShort If UShort.TryParse(txtMonedas001.Text, v) = False Then e.Cancel = True 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) Else txtImporte001.Text = (0.01 * v).ToString End If End Sub 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 Dim CantidadTotal As Single ' entero de 32 bits... If (Inicializado = True) Then CantidadTotal = 0 CantidadTotal += Single.Parse(txtImporte50.Text) CantidadTotal += Single.Parse(txtImporte20.Text) CantidadTotal += Single.Parse(txtImporte10.Text) CantidadTotal += Single.Parse(txtImporte5.Text) CantidadTotal += Single.Parse(txtImporte2.Text) CantidadTotal += Single.Parse(txtImporte1.Text) CantidadTotal += Single.Parse(txtImporte050.Text) CantidadTotal += Single.Parse(txtImporte020.Text) CantidadTotal += Single.Parse(txtImporte010.Text) CantidadTotal += Single.Parse(txtImporte005.Text) CantidadTotal += Single.Parse(txtImporte002.Text) CantidadTotal += Single.Parse(txtImporte001.Text) txtTotal.Text = CantidadTotal.ToString End If End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Inicializado = True End Sub Private Sub txtBillete50_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBillete50.KeyPress If Asc(e.KeyChar) = 13 Then txtBillete20.Focus() e.Handled = True End If End Sub Private Sub txtBillete20_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBillete20.KeyPress If Asc(e.KeyChar) = 13 Then txtBillete10.Focus() e.Handled = True End If End Sub Private Sub txtBillete10_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBillete10.KeyPress If Asc(e.KeyChar) = 13 Then txtBillete5.Focus() e.Handled = True End If End Sub Private Sub txtBillete5_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBillete5.KeyPress If Asc(e.KeyChar) = 13 Then txtMonedas2.Focus() e.Handled = True End If End Sub Private Sub txtMonedas2_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas2.KeyPress If Asc(e.KeyChar) = 13 Then txtMonedas1.Focus() e.Handled = True End If End Sub Private Sub txtMonedas1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas1.KeyPress If Asc(e.KeyChar) = 13 Then txtMonedas050.Focus() e.Handled = True End If End Sub Private Sub txtMonedas050_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas050.KeyPress If Asc(e.KeyChar) = 13 Then txtMonedas020.Focus() e.Handled = True End If End Sub Private Sub txtMonedas020_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas020.KeyPress If Asc(e.KeyChar) = 13 Then txtMonedas010.Focus() e.Handled = True End If End Sub Private Sub txtMonedas010_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas010.KeyPress If Asc(e.KeyChar) = 13 Then txtMonedas005.Focus() e.Handled = True End If End Sub Private Sub txtMonedas005_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas005.KeyPress If Asc(e.KeyChar) = 13 Then txtMonedas002.Focus() e.Handled = True End If End Sub Private Sub txtMonedas002_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas002.KeyPress If Asc(e.KeyChar) = 13 Then txtMonedas001.Focus() e.Handled = True End If End Sub Private Sub txtMonedas001_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas001.KeyPress If Asc(e.KeyChar) = 13 Then txtTotal1.Focus() e.Handled = True End If End Sub End Class
|
|
|
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/zk7mkPublic Class Form1 Private Inicializado As Boolean 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 sender.backcolor = Color.White txtTotal.Visible = True End Sub 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 sender.backcolor = Color.White txtTotal.Visible = True End Sub Private Sub txtBillete50_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete50.Validating Dim v As UShort 'UInt16 entero de 16 bits (valor en el rango: 0-65536) ' si admite un valor negativo, cambia al tipo short (int16) If UShort.TryParse(txtBillete50.Text, v) = False Then e.Cancel = True Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 50'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning) 'txtImporte50.Text ="0" Else txtImporte50.Text = (v * 50).ToString End If End Sub Private Sub txtBillete20_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete20.Validating Dim v As UShort If UShort.TryParse(txtBillete20.Text, v) = False Then e.Cancel = True Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 20'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning) Else txtImporte20.Text = (v * 20).ToString End If End Sub Private Sub txtBillete10_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete10.Validating Dim v As UShort If UShort.TryParse(txtBillete10.Text, v) = False Then e.Cancel = True Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 10'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning) Else txtImporte10.Text = (v * 10).ToString End If End Sub Private Sub txtBillete5_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete5.Validating Dim v As UShort If UShort.TryParse(txtBillete5.Text, v) = False Then e.Cancel = True Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 5'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning) Else txtImporte5.Text = (v * 5).ToString End If End Sub Private Sub txtMonedas2_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas2.Validating Dim v As UShort If UShort.TryParse(txtMonedas2.Text, v) = False Then e.Cancel = True Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 2'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning) Else txtImporte2.Text = (v * 2).ToString End If End Sub Private Sub txtMonedas1_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas1.Validating Dim v As UShort If UShort.TryParse(txtMonedas1.Text, v) = False Then e.Cancel = True Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 1'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning) Else txtImporte1.Text = (v * 1).ToString End If End Sub Private Sub txtMonedas050_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas050.Validating Dim v As UShort If UShort.TryParse(txtMonedas050.Text, v) = False Then e.Cancel = True 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) Else txtImporte050.Text = (0.5 * v).ToString End If End Sub Private Sub txtMonedas020_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas020.Validating Dim v As UShort If UShort.TryParse(txtMonedas020.Text, v) = False Then e.Cancel = True 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) Else txtImporte020.Text = (0.2 * v).ToString End If End Sub Private Sub txtMonedas010_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas010.Validating Dim v As UShort If UShort.TryParse(txtMonedas010.Text, v) = False Then e.Cancel = True 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) Else txtImporte010.Text = (0.1 * v).ToString End If End Sub Private Sub txtMonedas005_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas005.Validating Dim v As UShort If UShort.TryParse(txtMonedas005.Text, v) = False Then e.Cancel = True 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) Else txtImporte005.Text = (0.05 * v).ToString End If End Sub Private Sub txtMonedas002_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas002.Validating Dim v As UShort If UShort.TryParse(txtMonedas002.Text, v) = False Then e.Cancel = True 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) Else txtImporte002.Text = (0.02 * v).ToString End If End Sub Private Sub txtMonedas001_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas001.Validating Dim v As UShort If UShort.TryParse(txtMonedas001.Text, v) = False Then e.Cancel = True 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) Else txtImporte001.Text = (0.01 * v).ToString End If End Sub 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 Dim CantidadTotal As Single ' entero de 32 bits... If (Inicializado = True) Then CantidadTotal = 0 CantidadTotal += Single.Parse(txtImporte50.Text) CantidadTotal += Single.Parse(txtImporte20.Text) CantidadTotal += Single.Parse(txtImporte10.Text) CantidadTotal += Single.Parse(txtImporte5.Text) CantidadTotal += Single.Parse(txtImporte2.Text) CantidadTotal += Single.Parse(txtImporte1.Text) CantidadTotal += Single.Parse(txtImporte050.Text) CantidadTotal += Single.Parse(txtImporte020.Text) CantidadTotal += Single.Parse(txtImporte010.Text) CantidadTotal += Single.Parse(txtImporte005.Text) CantidadTotal += Single.Parse(txtImporte002.Text) CantidadTotal += Single.Parse(txtImporte001.Text) txtTotal.Text = CantidadTotal.ToString End If End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Inicializado = True End Sub Private Sub txtBillete50_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBillete50.KeyPress If Asc(e.KeyChar) = 13 Then txtBillete20.Focus() e.Handled = True End If End Sub Private Sub txtBillete20_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBillete20.KeyPress If Asc(e.KeyChar) = 13 Then txtBillete10.Focus() e.Handled = True End If End Sub Private Sub txtBillete10_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBillete10.KeyPress If Asc(e.KeyChar) = 13 Then txtBillete5.Focus() e.Handled = True End If End Sub Private Sub txtBillete5_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBillete5.KeyPress If Asc(e.KeyChar) = 13 Then txtMonedas2.Focus() e.Handled = True End If End Sub Private Sub txtMonedas2_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas2.KeyPress If Asc(e.KeyChar) = 13 Then txtMonedas1.Focus() e.Handled = True End If End Sub Private Sub txtMonedas1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas1.KeyPress If Asc(e.KeyChar) = 13 Then txtMonedas050.Focus() e.Handled = True End If End Sub Private Sub txtMonedas050_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas050.KeyPress If Asc(e.KeyChar) = 13 Then txtMonedas020.Focus() e.Handled = True End If End Sub Private Sub txtMonedas020_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas020.KeyPress If Asc(e.KeyChar) = 13 Then txtMonedas010.Focus() e.Handled = True End If End Sub Private Sub txtMonedas010_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas010.KeyPress If Asc(e.KeyChar) = 13 Then txtMonedas005.Focus() e.Handled = True End If End Sub Private Sub txtMonedas005_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas005.KeyPress If Asc(e.KeyChar) = 13 Then txtMonedas002.Focus() e.Handled = True End If End Sub Private Sub txtMonedas002_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas002.KeyPress If Asc(e.KeyChar) = 13 Then txtMonedas001.Focus() e.Handled = True End If End Sub Private Sub txtMonedas001_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas001.KeyPress If Asc(e.KeyChar) = 13 Then txtTotal1.Focus() e.Handled = True End If End Sub 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 End Sub 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/tgk55Public Class Form1 Private Inicializado As Boolean 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 sender.backcolor = Color.White txtTotal.Visible = True End Sub 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 sender.backcolor = Color.White txtTotal.Visible = True End Sub Private Sub txtBillete50_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete50.Validating Dim v As UShort 'UInt16 entero de 16 bits (valor en el rango: 0-65536) ' si admite un valor negativo, cambia al tipo short (int16) If UShort.TryParse(txtBillete50.Text, v) = False Then e.Cancel = True Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 50'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning) 'txtImporte50.Text ="0" Else txtImporte50.Text = (v * 50).ToString End If End Sub Private Sub txtBillete20_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete20.Validating Dim v As UShort If UShort.TryParse(txtBillete20.Text, v) = False Then e.Cancel = True Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 20'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning) Else txtImporte20.Text = (v * 20).ToString End If End Sub Private Sub txtBillete10_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete10.Validating Dim v As UShort If UShort.TryParse(txtBillete10.Text, v) = False Then e.Cancel = True Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 10'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning) Else txtImporte10.Text = (v * 10).ToString End If End Sub Private Sub txtBillete5_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtBillete5.Validating Dim v As UShort If UShort.TryParse(txtBillete5.Text, v) = False Then e.Cancel = True Call MessageBox.Show("No puede tomarse como un numero el valor para 'billete de 5'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning) Else txtImporte5.Text = (v * 5).ToString End If End Sub Private Sub txtMonedas2_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas2.Validating Dim v As UShort If UShort.TryParse(txtMonedas2.Text, v) = False Then e.Cancel = True Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 2'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning) Else txtImporte2.Text = (v * 2).ToString End If End Sub Private Sub txtMonedas1_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas1.Validating Dim v As UShort If UShort.TryParse(txtMonedas1.Text, v) = False Then e.Cancel = True Call MessageBox.Show("No puede tomarse como un numero el valor para 'monedas de 1'.", "Error: No es un numero.", MessageBoxButtons.OK, MessageBoxIcon.Warning) Else txtImporte1.Text = (v * 1).ToString End If End Sub Private Sub txtMonedas050_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas050.Validating Dim v As Single If Single.TryParse(txtMonedas050.Text, v) = False Then e.Cancel = True 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) Else txtImporte050.Text = (v * 0.5).ToString End If End Sub Private Sub txtMonedas020_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas020.Validating Dim v As Single If Single.TryParse(txtMonedas020.Text, v) = False Then e.Cancel = True 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) Else txtImporte020.Text = (v * 0.2).ToString End If End Sub Private Sub txtMonedas010_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas010.Validating Dim v As Single If Single.TryParse(txtMonedas010.Text, v) = False Then e.Cancel = True 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) Else txtImporte010.Text = (v * 0.1).ToString End If End Sub Private Sub txtMonedas005_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas005.Validating Dim v As Single If Single.TryParse(txtMonedas005.Text, v) = False Then e.Cancel = True 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) Else txtImporte005.Text = (v * 0.05).ToString End If End Sub Private Sub txtMonedas002_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas002.Validating Dim v As Single If Single.TryParse(txtMonedas002.Text, v) = False Then e.Cancel = True 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) Else txtImporte002.Text = (v * 0.02).ToString End If End Sub Private Sub txtMonedas001_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles txtMonedas001.Validating Dim v As Single If Single.TryParse(txtMonedas001.Text, v) = False Then e.Cancel = True 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) Else txtImporte001.Text = (v * 0.01).ToString End If End Sub Private Sub Totalizar() Handles txtImporte50.TextChanged, txtImporte20.TextChanged, txtImporte10.TextChanged Dim CantidadTotal As Single ' entero de 32 bits... If (Inicializado = True) Then CantidadTotal = 0 CantidadTotal += Single.Parse(txtImporte50.Text) CantidadTotal += Single.Parse(txtImporte20.Text) CantidadTotal += Single.Parse(txtImporte10.Text) CantidadTotal += Single.Parse(txtImporte5.Text) CantidadTotal += Single.Parse(txtImporte2.Text) CantidadTotal += Single.Parse(txtImporte1.Text) CantidadTotal += Single.Parse(txtImporte050.Text) CantidadTotal += Single.Parse(txtImporte020.Text) CantidadTotal += Single.Parse(txtImporte010.Text) CantidadTotal += Single.Parse(txtImporte005.Text) CantidadTotal += Single.Parse(txtImporte002.Text) CantidadTotal += Single.Parse(txtImporte001.Text) txtTotal.Text = CantidadTotal.ToString End If End Sub Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Inicializado = True End Sub Private Sub txtBillete50_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBillete50.KeyPress If Asc(e.KeyChar) = 13 Then txtBillete20.Focus() e.Handled = True End If End Sub Private Sub txtBillete20_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBillete20.KeyPress If Asc(e.KeyChar) = 13 Then txtBillete10.Focus() e.Handled = True End If End Sub Private Sub txtBillete10_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBillete10.KeyPress If Asc(e.KeyChar) = 13 Then txtBillete5.Focus() e.Handled = True End If End Sub Private Sub txtBillete5_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtBillete5.KeyPress If Asc(e.KeyChar) = 13 Then txtMonedas2.Focus() e.Handled = True End If End Sub Private Sub txtMonedas2_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas2.KeyPress If Asc(e.KeyChar) = 13 Then txtMonedas1.Focus() e.Handled = True End If End Sub Private Sub txtMonedas1_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas1.KeyPress If Asc(e.KeyChar) = 13 Then txtMonedas050.Focus() e.Handled = True End If End Sub Private Sub txtMonedas050_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas050.KeyPress If Asc(e.KeyChar) = 13 Then txtMonedas020.Focus() e.Handled = True End If End Sub Private Sub txtMonedas020_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas020.KeyPress If Asc(e.KeyChar) = 13 Then txtMonedas010.Focus() e.Handled = True End If End Sub Private Sub txtMonedas010_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas010.KeyPress If Asc(e.KeyChar) = 13 Then txtMonedas005.Focus() e.Handled = True End If End Sub Private Sub txtMonedas005_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas005.KeyPress If Asc(e.KeyChar) = 13 Then txtMonedas002.Focus() e.Handled = True End If End Sub Private Sub txtMonedas002_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas002.KeyPress If Asc(e.KeyChar) = 13 Then txtMonedas001.Focus() e.Handled = True End If End Sub Private Sub txtMonedas001_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtMonedas001.KeyPress If Asc(e.KeyChar) = 13 Then txtTotal1.Focus() e.Handled = True End If End Sub Private Sub Totalizar(sender As Object, e As EventArgs) Handles txtImporte50.TextChanged, txtImporte20.TextChanged, txtImporte10.TextChanged End Sub End Class
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
|
|
|
|
|
|
|