Visual Basic - Juntos Tildados

Life is soft - evento anual de software empresarial
 
Vista:

Juntos Tildados

Publicado por Domingo (13 intervenciones) el 30/10/2010 03:50:41
Hola Sres. aclaro solamente tengo 1 FRAME solamente que dentro se encuentra el sistema operativo y sin FRAME esta procesador , yo tengo que tildar un procesador y automaticamente se tiene que tildar un sistema operativo osea los 2 OptionButtion quedar tildados...Aguardo repuestas.... Email : [email protected]

Este es el trabajo que ya tengo hecho , me falta que los OptionButtion (optpentium y optwindows95) queden tildados juntos....

Private Sub cmdcerrar_Click()
End
End Sub
Private Sub cmdnuevo_Click()
Opt486.Enabled = True
optpentium.Enabled = True
optpentiumpro.Enabled = True
optwindows95.Enabled = True
optwindows98.Enabled = True
optwindowsme.Enabled = True
optwindowsnt.Enabled = True
Text1.Text = ""
Opt486.Value = 0
optpentium.Value = 0
optpentiumpro.Value = 0
optwindows95.Value = 0
optwindows98.Value = 0
optwindowsme.Value = 0
optwindowsnt.Value = 0
End Sub
Private Sub Opt486_Click()
Text1.Text = "ud.tiene un procesador 486 con un sistema operativo windows 95"
Opt486.Enabled = True
optpentium.Enabled = False
optpentiumpro.Enabled = False
optwindows95.Enabled = True
optwindows98.Enabled = False
optwindowsme.Enabled = False
optwindowsnt.Enabled = False
End Sub
Private Sub optpentium_Click()
Text1.Text = "ud. tene un procesador pentium con un sistema operativo windows 98"
Opt486.Enabled = False
optpentium.Enabled = True
optpentiumpro.Enabled = False
optwindows95.Enabled = False
optwindows98.Enabled = True
optwindowsme.Enabled = False
optwindowsnt.Enabled = False
End Sub
Private Sub optpentiumpro_Click()
Text1.Text = "ud. tiene un procesador pentium pro con un sistema operativo windows me"
Opt486.Enabled = False
optpentium.Enabled = False
optpentiumpro.Enabled = True
optwindows95.Enabled = False
optwindows98.Enabled = False
optwindowsme.Enabled = True
optwindowsnt.Enabled = False
End Sub
Private Sub optwindows95_Click()
Text1.Text = "ud. tiene un sistema operativo windows 95"
End Sub
Private Sub optwindows98_Click()
Text1.Text = "ud.tiene un sistema operativa windows 98"
End Sub
Private Sub optwindowsme_Click()
Text1.Text = "ud. tiene un sistema operativo windows me"
End Sub
Private Sub optwindowsnt_Click()
Text1.Text = "ud. tiene un sistema operativo windows nt"
End Sub
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Juntos Tildados

Publicado por Javier (44 intervenciones) el 30/10/2010 21:31:03
Para que en una misma ventana puedas tener 2 option seleccionados, as de meterlos dentro de otro control, normalmente se meten en un Picture

saludos
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Juntos Tildados

Publicado por Antoni Masana (79 intervenciones) el 01/11/2010 12:46:32
He modificado un poco tu proceso y he renombrado los controles

Private Sub cmd_Cerrar_Click()
End
End Sub
' --------------------------------------------------------------
Private Sub cmd_Nuevo_Click()
Opt_486.Enabled = True
Opt_Pen.Enabled = True
Opt_Pro.Enabled = True

Opt_Win_95.Enabled = True
Opt_Win_98.Enabled = True
Opt_Win_Me.Enabled = True
Opt_Win_NT.Enabled = True

Text1.Text = ""
Opt_486.Value = 0
Opt_Pen.Value = 0
Opt_Pro.Value = 0

Opt_Win_95.Value = 0
Opt_Win_98.Value = 0
Opt_Win_Me.Value = 0
Opt_Win_NT.Value = 0
End Sub

'====================================

Private Sub Opt_486_Click()
Opt_486.Enabled = True
Opt_Pen.Enabled = False
Opt_Pro.Enabled = False

Opt_Win_95.Value = True ' --- Nuevo

Opt_Win_95.Enabled = True
Opt_Win_98.Enabled = False
Opt_Win_Me.Enabled = False
Opt_Win_NT.Enabled = False

' --- Cambio ubicación

Text1.Text = "ud.tiene un procesador 486 con un sistema operativo windows 95"
End Sub
' --------------------------------------------------------------
Private Sub Opt_Pen_Click()

Opt_486.Enabled = False
Opt_Pen.Enabled = True
Opt_Pro.Enabled = False

Opt_Win_95.Value = True ' --- Nuevo

Opt_Win_95.Enabled = False
Opt_Win_98.Enabled = True
Opt_Win_Me.Enabled = False
Opt_Win_NT.Enabled = False

' --- Cambio ubicación

Text1.Text = "ud.tiene un procesador 486 con un sistema operativo windows 95"
End Sub
' --------------------------------------------------------------
Private Sub opt_Pro_Click()
Opt_486.Enabled = False
Opt_Pen.Enabled = False
Opt_Pro.Enabled = True

Opt_Win_Me.Value = True ' --- Nuevo

Opt_Win_95.Enabled = False
Opt_Win_98.Enabled = False
Opt_Win_Me.Enabled = True
Opt_Win_NT.Enabled = False

' --- Cambio ubicación

Text1.Text = "ud. tiene un procesador pentium pro con un sistema operativo windows Me"
End Sub

'====================================

Private Sub opt_Win_95_Click()
Text1.Text = "ud. tiene un sistema operativo windows 95"
End Sub
' --------------------------------------------------------------
Private Sub opt_Win_98_Click()
Text1.Text = "ud.tiene un sistema operativa windows 98"
End Sub
' --------------------------------------------------------------
Private Sub opt_win_Me_Click()
Text1.Text = "ud. tiene un sistema operativo windows Me"
End Sub
' --------------------------------------------------------------
Private Sub opt_Win_NT_Click()
Text1.Text = "ud. tiene un sistema operativo windows NT"
End Sub

'====================================

- He realizado el programa y he creado los 4 OptionButton del Sistema operativo sobre el Formulario.
- He creado un Frame y en el interior los tres OptionButton del procesador.
- El TextBox y los dos Botones.
- El Frame le he puesto BorderStyle=0

Con los cambios que he realizado en el programa en los 3 OptionButton del sistema operativo ya funciona:

Veras que le he puesto un:

Opt_Win_95.Value = True

Esto marca el OptionButton que se desea que este marcado pero por otro lado ejecuta el proceso:

Private Sub opt_Win_95_Click()

Por lo que asigno el texto al TextBox al final

Saludos
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Juntos Tildados

Publicado por Antoni Masana (79 intervenciones) el 02/11/2010 08:07:15
No entiendo que es lo que deseas

A la rutina que te mostre debes cambiar la ultima linea

Private Sub Opt_486_Click()
Opt_486.Enabled = True
Opt_Pen.Enabled = False
Opt_Pro.Enabled = False

Opt_Win_95.Value = True

Opt_Win_95.Enabled = True
Opt_Win_98.Enabled = False
Opt_Win_Me.Enabled = False
Opt_Win_NT.Enabled = False

Text1.Text = "ud.tiene un procesador 486 con un sistema operativo windows 95"
End Sub

==================

Private Sub Opt_486_Click()
Opt_486.Enabled = True
Opt_Pen.Enabled = False
Opt_Pro.Enabled = False

Opt_Win_95.Value = True

Opt_Win_95.Enabled = True
Opt_Win_98.Enabled = False
Opt_Win_Me.Enabled = False
Opt_Win_NT.Enabled = False

IF instr(Text1.Text, " con ") = 0 then
Text1.Text = Text1.Text + "con un sistema operativo windows 95"
else
Text1.Text = left(Text1.Text, instr(Text1.Text, " con "))+"con un sistema operativo windows 95"
end if

=================

¿ Que hace la condicion ?

Si no existe la frase " con un sistema operativo..." Añade al texto del procesador la la versión del S.O.
Si ya tiene el texto del S.O. toma el trozo de texto del procesador y añade el S.O.

Si esto no soluciona tu problema es por que no la explicación es muy vaga y el programa no hace lo que en realidad deseas que haga.

Las modificaciones que realice estan basadas en lo que entendi que deseabas pero resulta que no es asi

La pregunta fundamental es ¿ Que debe hacer el programa ?
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

Seleccionando

Publicado por Domingo (13 intervenciones) el 02/11/2010 02:10:23
Hola Sr. Amigo ...!!! Tengo un trabajo que terminar (Visual Basic 6.0) , me falta que el "TEXT1" aparesca la fase :
(UD. Tiene Un Procesador 486 con el Sistema Operativo Windows 95)
(UD. Tiene Un Procesador 486 con el Sistema Operativo Windows 98)
(UD. Tiene Un Procesador 486 con el Sistema Operativo Windows ME)
(UD. Tiene Un Procesador 486 con el Sistema Operativo Windows NT)

...Seleccionando un Procesador y luego un Sistema Operativo. Aguardo respuesta desde ya Gracias ...

COCADENAR: Significa que podemos a un TEXTO ir acoplandole la información que queremos.

Private Sub cmdcerrar_Click()
End
End Sub
Private Sub cmdnuevo_Click()
Opt486.Enabled = True
optpentium.Enabled = True
optpentiumpro.Enabled = True
optwindows95.Enabled = True
optwindows98.Enabled = True
optwindowsme.Enabled = True
optwindowsnt.Enabled = True
text1.Text = ""
Opt486.Value = 0
optpentium.Value = 0
optpentiumpro.Value = 0
optwindows95.Value = 0
optwindows98.Value = 0
optwindowsme.Value = 0
optwindowsnt.Value = 0
End Sub
Private Sub Opt486_Click()
text1.Text = "Procesador 486"
Opt486.Enabled = True
optpentium.Enabled = False
optpentiumpro.Enabled = False

End Sub
Private Sub optpentium_Click()
text1.Text = "Procesador Pentium"
Opt486.Enabled = False
optpentium.Enabled = True
optpentiumpro.Enabled = False

End Sub
Private Sub optpentiumpro_Click()
text1.Text = "Procesador Pentium Pro"
Opt486.Enabled = False
optpentium.Enabled = False
optpentiumpro.Enabled = True

End Sub
Private Sub optwindows95_Click()
text1.Text = "Sistema Operativo Windows 95"
End Sub
Private Sub optwindows98_Click()
text1.Text = "Sistema Operativa Windows 98"
End Sub
Private Sub optwindowsme_Click()
text1.Text = "Sistema Operativo Windows ME"
End Sub
Private Sub optwindowsnt_Click()
text1.Text = "Sistema Operativo Windows NT"
End Sub
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar