monControle.Focus()
Dim ArrivéeALaFinDeLaShape As Boolean If ArrivéeALaFinDeLaShape=True Then Shape4.focus() End If
(j'imageine qu'on tape une instruction du type
Dim ArrivéeALaFinDeLaShape As Boolean If ArrivéeALaFinDeLaShape=True Then Shape4.focus() End If
Private Sub RectangleShape_KeyPress(Byval sender As Object, Byval e As System.Forms.KeyPressEventArgs) Handles RectangleShape_KeyPress Dim ch As Char ch = e.KeyChar MsgBox("Vous avez pressé la touche "&ch) End Sub
Dim i As Integer Dim imax As Integer = 20 While i < imax RectangleShape_KeyPress(??????) Wend Private Sub RectangleShape_KeyPress(Byval sender As Object, Byval e As System.Forms.KeyPressEventArgs) Handles RectangleShape_KeyPress Dim ch As Char ch = e.KeyChar oWord.ActiveDocument.Shapes(4).TextFrame.TextRange.Text = ch i=i+1 End Sub
RectangleShape_KeyPress(??????)
RectangleShape_KeyPress(ByVal sender As Objet, ByVal e As System.Forms.KeyPressEventArgs) Handles RectangleShape.KeyPress
Imports Microsoft.VisualBasic.PowerPacks
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionMon problème était que, ne réussissant pas à placer (à "coller") physiquement des Textbox sur une image "collée" elle-même sur un document Word, nous en étions arrivés à la possibilité de se servir de Shapes plutôt que de Textbox.heu....
For each ctrl as Control in Me.Controls If typeof ctrl is Textbox Then Ctrl.Text = Textbox.Id End
RichTextBox.Text = "chaîne de caractère"
Private Sub RichTextBox_KeyPress(Byval sender As System.Objet, ByVal As System.Windows.Forms.KeyPressEventArgs) Handles RichTextBox.KeyPress Dim count As Integer =0 While Count < 15 RichTextBox.Text = e.KeyChar Count=count+1 End While End Sub
Option Strict On option Explicit On Imports ImageSurForm Imports Microsoft.Office.Interop Imports Microsoft.Office.Interop.Word Public Class Form1 Dim oWord As New Word.Application Private Sub richTextBox1_click(Byval sender As System.Objet, ByVal e As System.EventArgs) Handles RichTextBox1.click Dim texte As String RichTextBox1.Focus() AddmyText(texte) End Sub Private Sub AddMyText(ByVal textToAdd As String) richTextBox1.MaxLength = 20 If textToAdd.Length > richTextBox1.MaxLength Then MessageBox.Show("Texte trop long") Else richTextBox1.SelectedText = textToAdd End If End Sub End Class