Cita de: Leo Gutiérrez. en 17 Junio 2013, 21:13 PM
Parece que solo participaré yo
Danos tiempo!
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúCita de: Leo Gutiérrez. en 17 Junio 2013, 21:13 PM
Parece que solo participaré yo
#!/bin/sh
#script created by James Jara (google codes)
#url
url='http://gadget.citasyrefranes.com/gadget_xml.php?t=PI&r=83'
#get data
data=` wget -q -O - $url | sed -n -e 's/.*<texto>\(.*\)<\/texto>.*/\1/p'`
#subir volumen a tope xD
amixer sset Master 100%
#decir piropo
#echo "${data}" | festival --tts
#por si no tenéis instalado el festival
#espeak "${data}"
#opción alternativa sin trolleo
#notify-send "Frase Piropo" "${data}"
Public Function Voltear(ByVal Texto As String) As String
Dim i As Long, l As Long
l = Len(Texto)
For i = 1 To l
Voltear = Voltear & Mid(Texto, l, 1)
l = l - 1
Next
End Function
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
textbox2.text = voltear(textbox1.text) 'voltea texto
End Sub
Public Class Form1
Private Sub NewButton(ByVal ButtonNumber As Integer)
' Create a new button
Dim oButton As Button
oButton = New Button
' Set properties. Change these as you like and set other props if needed
oButton.Enabled = True
oButton.Location = New Point(ButtonNumber * 30, ButtonNumber * 30)
oButton.Name = "MyButton" & ButtonNumber.ToString
oButton.Size = New Size(75, 23)
oButton.Text = "Button" & ButtonNumber.ToString
oButton.Visible = True
' Use Tag property to store "which button" information
oButton.Tag = ButtonNumber
' Add button click handler
AddHandler oButton.Click, AddressOf onButtonClick
' Add to this forms controls collection
Me.Controls.Add(oButton)
End Sub
Private Sub MyFunc(ByVal ButtonNumber As Integer)
' Do your stuff here
MessageBox.Show("You clicked button: " & ButtonNumber.ToString, "Click", MessageBoxButtons.OK, MessageBoxIcon.Information)
End Sub
Private Sub onButtonClick(ByVal sender As System.Object, ByVal e As System.EventArgs)
' Handle button click and check which button is clicked
Dim ButtonNumber As Integer
' Get Tag property. Cast sender to Button first
If CType(sender, Button).Tag IsNot Nothing Then
' Check that button's Tag property contains a valid integer
If Integer.TryParse(CType(sender, Button).Tag.ToString, ButtonNumber) Then
' Now we have a valid button number to be used
MyFunc(ButtonNumber)
End If
End If
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
' Create buttons dynamically on form load
Dim i As Integer
For i = 0 To 30
NewButton(i)
Next i
End Sub
End Class