Ich Möchte alle Controls einer Form Auflisten um die Eigenschaft Text anzupassen an die aktuelle Programsprache.
ich habe Folgendes bereits gefunden:
Alle Controls einer Form auflisten - Sonstige Problemstellungen - VB-Paradise 2.0 — Die große Visual–Basic– und .NET–Community (vb-paradise.de)
aber leider bekomme ich diese mit dem ContextMenuStrip nicht hin.
Kann mir jemand sagen was ich Falsch mache?
ich habe Folgendes bereits gefunden:
Alle Controls einer Form auflisten - Sonstige Problemstellungen - VB-Paradise 2.0 — Die große Visual–Basic– und .NET–Community (vb-paradise.de)
aber leider bekomme ich diese mit dem ContextMenuStrip nicht hin.
VB.NET-Quellcode
- Public Class Form1
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- DoToAllControls(Me)
- End Sub
- Sub DoToAllControls(ByVal m_Control As Control)
- For Each ctrl As Control In m_Control.Controls
- If ctrl.Controls.Count > 0 Then
- DoToAllControls(ctrl)
- End If
- If ctrl.GetType().Equals(GetType(ContextMenuStrip)) Then
- For Each item As ToolStripItem In DirectCast(ctrl, ContextMenuStrip).Items
- MsgBox(item.Name)
- Next
- End If
- MsgBox(ctrl.Name)
- Next
- End Sub
- End Class
Kann mir jemand sagen was ich Falsch mache?