|
-
Jul 14th, 2007, 01:48 PM
#1
Thread Starter
Lively Member
[RESOLVED] changing listview location at runtime
Code:
frm2.ListView1.Location = New Point(0, 300)
frm2.Refresh()
MsgBox("loc: " & frm2.ListView1.Location.ToString)
I get msgbox (x=0),(y=0)
How come "y" doesn't change to 300?
I wish to simply move the position of the listview.
Last edited by jeffnyc; Jul 14th, 2007 at 01:52 PM.
-
Jul 14th, 2007, 01:57 PM
#2
Re: changing listview location at runtime
Is frm2 a created instance of a form, or is it the default instance?
-
Jul 14th, 2007, 02:06 PM
#3
Thread Starter
Lively Member
Re: changing listview location at runtime
I declare frm2 in a module as
Code:
Friend frm2 As Form2
Then in a form1 I instantiate frm2 from a command button:
Code:
Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
'loads display screen
frm2 = New Form2()
frm2.Show()
frm2.startTimer()
End Sub
I've been able to change other properties of frm2 using this method from outside that form.
-
Jul 14th, 2007, 03:51 PM
#4
Thread Starter
Lively Member
Re: changing listview location at runtime
Code:
Me.ListView1.Location = New Point(100, 300)
MsgBox("loc: " & Me.ListView1.Location.ToString)
I even tried within form2 itself using the Me keyword. Same result.
Update... think I resolved it. Had to with one of the other property settings such as alignment = snap to grid or dock = fill , not sure which but changed both and works =)
Last edited by jeffnyc; Jul 14th, 2007 at 03:58 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|