Siento la tardanza, no se si a alguien le habría hecho falta o no...
Código Visual.NET:
Ver originalPublic Shared Sub añadirControlEmergente(ByVal nombre As String, ByVal txt As System.Object, ByRef controls As System.Windows.Forms.Control.ControlCollection)
'WaitSeconds(1)
'System.Threading.Thread.Sleep(1000)
Dim tamaño_ini As Integer = txt.Width
'Aproximadamente, cada caracter puede ocupar como media 7px de ancho
Dim tamaño_min As Integer = txt.Text.Length * 7
If txt.Text <> "" And tamaño_min > tamaño_ini Then
'Solo si el control se encuentra en un contenedor que modifique el Location del control
Dim container As Control
container = txt.Parent
Dim label As New Label
label = New Label()
label.Name = nombre
label.Text = txt.Text
label.AutoSize = True
label.BringToFront()
label.BackColor = Color.Ivory
label.BorderStyle = BorderStyle.FixedSingle
label.Location = New System.Drawing.Point(txt.Location.X + container.Location.X + 18, txt.Location.Y + container.Location.Y - 18)
controls.Add(label)
label.BringToFront()
End If
End Sub
Public Shared Sub eliminarControl(ByRef control As String, ByRef controls As System.Windows.Forms.Control.ControlCollection)
'WaitSeconds(1)
'System.Threading.Thread.Sleep(1000)
Dim ctl As Control
For Each ctl In controls
If TypeOf ctl Is Label Then
If ctl.Name.Equals(control) Then
controls.Remove(ctl)
End If
End If
Next
End Sub
Código Visual Basic:
Ver originalPrivate Sub ratonEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ... 'EVENTOS MouseEnter
añadirControlEmergente("EMERGENTE", sender, Me.Controls)
End Sub
Private Sub ratonLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ... 'EVENTOS MouseLeave
eliminarControl("EMERGENTE", Me.Controls)
End Sub
Private Sub ratonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles ...'EVENTOS MouseClick
eliminarControl("EMERGENTE", Me.Controls)
End Sub
Private Sub cmb_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles ...'EVENTOS KeyPress de los Combobox
If not modificar then
e.Handled = True
End If
...
End Sub
Si alguien tiene alguna duda sobre porque he hecho lo que he hecho, que pregunt,e porque hoy no tengo tiempo de explicar ...
Saludos