Forum: VB.NET |
Thema:
Re: AutoScrollPosition |
Von:
Tobi Ulm (
20.10.2004 17:53) |
Hallo Herr Herren,
alles O.K soweit in der Schweiz? Hier der Source zum Verschieben :
Public Class Form5
Inherits System.Windows.Forms.Form
#Region " Vom Windows Form Designer generierter Code "
Public Sub New()
MyBase.New()
InitializeComponent()
End Sub
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
Private components As System.ComponentModel.IContainer
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Panel1 As System.Windows.Forms.Panel
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.Button1 = New System.Windows.Forms.Button
Me.Panel1 = New System.Windows.Forms.Panel
Me.Button2 = New System.Windows.Forms.Button
Me.Button3 = New System.Windows.Forms.Button
Me.Panel1.SuspendLayout()
Me.SuspendLayout()
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(24, 24)
Me.Button1.Name = "Button1"
Me.Button1.TabIndex = 0
Me.Button1.Text = "Button1"
'
'Panel1
'
Me.Panel1.AutoScroll = True
Me.Panel1.Controls.Add(Me.Button2)
Me.Panel1.Location = New System.Drawing.Point(32, 96)
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing.Size(128, 56)
Me.Panel1.TabIndex = 1
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(64, 40)
Me.Button2.Name = "Button2"
Me.Button2.TabIndex = 0
Me.Button2.Text = "Button2"
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(336, 56)
Me.Button3.Name = "Button3"
Me.Button3.TabIndex = 2
Me.Button3.Text = "Button3"
'
'Form5
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(544, 500)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.Panel1)
Me.Controls.Add(Me.Button1)
Me.Name = "Form5"
Me.Text = "Form5"
Me.Panel1.ResumeLayout(False)
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Panel1.AutoScroll = True
Dim myButton As New Button
myButton.Text = "AUtoscroll"
myButton.Location = New Point( _
0 + Panel1.AutoScrollPosition.X, _
0 + Panel1.AutoScrollPosition.Y)
Panel1.Controls.Add(myButton)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Me.Panel1.AutoScrollPosition = New Point(Button2.Location.X, Button2.Location.Y)
End Sub
End Class
cu
Tobi
Betreff |
Von |
Datum |
|
  |
Re: AutoScrollPosition
Danke funktioniert, habe da wohl noch ein durcheinander mit den Koordinaten<br><br>Gruss Lukas<br> |
 |
 |
 |
|
|
Lukas
Herren
|
21.10.2004 09:38 |
|
|
Antworten
Vorsicht bei der Eingabe: Die Zeichen ' oder -- sind nicht erlaubt!