INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Couple of VB questions  (Read 2773 times)

nila

  • Guest
Couple of VB questions
« 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!!
Logged

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20062
Re:Couple of VB questions
« Reply #1 on: October 29, 2003, 02:15:26 pm »

Image1.Picture = LoadPicture(FilePath.text)

Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

RhinoBanga

  • Citizen of the Universe
  • *****
  • Posts: 1703
  • Developer
Re:Couple of VB questions
« Reply #2 on: October 29, 2003, 03:23:01 pm »

Quote
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.

Logged

nila

  • Guest
Re:Couple of VB questions
« Reply #3 on: October 30, 2003, 03:01:07 am »

Wahoo!!

Thanks guys.

How do I get the listindex position for a listview too?

U guys rock!
Logged

rrsavage

  • Regular Member
  • Recent member
  • *
  • Posts: 8
Re:Couple of VB questions
« Reply #4 on: October 30, 2003, 09:38:31 am »

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
Logged

nila

  • Guest
Re:Couple of VB questions
« Reply #5 on: November 22, 2003, 12:19:55 pm »

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!!
Logged

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20062
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

nila

  • Guest
Re:Couple of VB questions
« Reply #7 on: November 22, 2003, 03:50:20 pm »

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! :)
Logged

nila

  • Guest
Re:Couple of VB questions
« Reply #8 on: November 22, 2003, 03:52:12 pm »

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 :(
Logged

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20062
Re:Couple of VB questions
« Reply #9 on: November 22, 2003, 05:20:35 pm »

Quote
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.
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA

nila

  • Guest
Re:Couple of VB questions
« Reply #10 on: November 23, 2003, 05:23:49 pm »

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 :)
Logged

KingSparta

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 20062
Re:Couple of VB questions
« Reply #11 on: November 23, 2003, 05:55:46 pm »

try this

add HScroll1 control

Private Sub HScroll1_Change()
    UserControl.BackColor = HScroll1.Value
End Sub
Logged
Retired Military, Airborne, Air Assault, And Flight Wings.
Model Trains, Internet, Ham Radio, Music
https://MyAAGrapevines.com
https://centercitybbs.com
Fayetteville, NC, USA
Pages: [1]   Go Up