INTERACT FORUM
Windows => Plug-in Development => Topic started by: nila on October 29, 2003, 02:05:08 pm
-
Hey :)
Couple of questions.
1. How do I load into a picture or imagebox a picture from say text1.text (when i enter the path in there) - cant seem to work it out and want to be able to set a picture box to display random pictures in my plugin.
2. How hard is it to create loads of picture (number decided at runtime) inside a box of some sort (like in MC when in thumbnail mode) so I could display a bunch of thumbnails in my plugin?
And if it's easy - could I get the code :)
Thanks guys!!
-
Image1.Picture = LoadPicture(FilePath.text)
-
2. How hard is it to create loads of picture (number decided at runtime) inside a box of some sort (like in MC when in thumbnail mode) so I could display a bunch of thumbnails in my plugin?
Depends.
The easiest (and least efficient way) of doing it would be to load each thumbnail in turn to a picturebox, shrink it and load it to an imagelist. Then load up a listview which has been associated with the imagelist.
-
Wahoo!!
Thanks guys.
How do I get the listindex position for a listview too?
U guys rock!
-
Assuming you mean a ListView control from the Visual Basic toolbar.
This code should give you the list index of the current selected list item:
ListView1.SelectedItem.Index
---------------------------------------------------------------
Private Sub Command1_Click()
'display current listview index
MsgBox ListView1.SelectedItem.Index & " : " & ListView1.SelectedItem.Text
End Sub
Private Sub Form_Load()
'set listview to report mode
ListView1.View = lvwReport
'add items to listview
ListView1.ListItems.Add , , "Item 1"
ListView1.ListItems.Add , , "Item 2"
ListView1.ListItems.Add , , "Item 3"
ListView1.ListItems.Add , , "Item 4"
ListView1.ListItems.Add , , "Item 5"
End Sub
-
Hey :)
This is coming along NICELY to TOTALLY re-vamp Website Creator - the file choser alone is going to be ten times better!!
Is there any way to control the spacing between the items in a list view though? For some reason it's leaving huge gaps between each column of pictures when using smallicon mode for the ListView?
LOVE list View though!!
-
May Help
http://www.mvps.org/vbnet/index.html?code/comctl/lvdemo4.htm (http://www.mvps.org/vbnet/index.html?code/comctl/lvdemo4.htm)
http://www.mvps.org/btmtz/listview/ (http://www.mvps.org/btmtz/listview/)
http://www.developerfusion.com/show/125 (http://www.developerfusion.com/show/125)
http://www.codeproject.com/useritems/ListView.asp (http://www.codeproject.com/useritems/ListView.asp)
-
King - I meant to ask you actually.
How do you change the background colour of your controls at runtime??
I cant seem to make it work on my plugins? Just causes a runtime error for me with the code I was trying :(
Your plugins all do it though? Whats the secret! :)
-
Oh yeah, and another question.
After I assign an Imagelist to the List View - how do I deassociated it?
Because I cant edit the Image List while it's associated to the List View - I need to first de-associated it so I can edit the Image List and then associated it again.
Cant work out how to deassociated it though :(
-
How do you change the background colour of your controls at runtime??
some things you can set at runtime somethings you can't if you can show how your doing it and to what control. maybe i can then see.
I am not a listview Pro myself, don't use it like how your trying to.
-
I meant the overall control - the plugin itself's background - not any control (like List View).
U let users chose the background colour to your plugins and thats what I was having problems changing :)
-
try this
add HScroll1 control
Private Sub HScroll1_Change()
UserControl.BackColor = HScroll1.Value
End Sub