![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Feb 2006
Posts: 4
Rep Power: 0
![]() |
[Help] Scripting with VB.net
Hello,
I just started working with VB.net after downloading the Visual Studio Express package. I've spent the day tinkering with it and I have to say - It's been a long time since I used VB... and it seems to be completely different than Vbscript (which is the language of choice the last couple of years).What I've been wanting to do is create a DeskShade-sque (http://www.macrabbit.com/deskshade/) like program for Windows: It basically organizes your wallpapers or pics and lets you add more and/or group them. It applies them or lets you hue/shift them, it shows a little icon in the menubar with the desktop you're currently using. It has pretty nice effects (fades, rotate while changing desktop, etc) and features(hotkeys, drag and drop, etc). I've been able to do it with VBscript but the results were less than consumer-friendly, hence the switch over to a language that offers a little more in the way of building an user interface. Now to the dilemma: I've gotten all the images created for the program and the layout of the program is complete, the problem is I haven't had much luck populating a ListView with the jpegs of a folder; actually, I've had even less luck with parsing the images into an imagelist...and now I'm at a complete loss. In Vbscript it was as simple as using a GetFiles() method and saving each image into an array but with VB.net... I know there are some genius programmers here and would really appreciate if someone might be able to point me in the right direction. Thankyou and I apologize for the length of this comment. |
|
|
|
|
|
#2 |
|
Newbie
Join Date: Feb 2006
Posts: 4
Rep Power: 0
![]() |
are there any activeX controls that deal with system tray icons that can be used with VBscript?
Thanks |
|
|
|
|
|
#3 | |
|
Hobbyist Programmer
|
Quote:
Private Sub AddImageToList(imageToLoad As String)
If imageToLoad <> "" Then
imageList1.Images.Add(Image.FromFile(imageToLoad))
End If
End Subwhere imageToLoad parameter is simply the path to the image. if you wanted to use an openfiledialogue control you could get the image's filenames like so:
openFileDialog1.Multiselect = True
If openFileDialog1.ShowDialog() = DialogResult.OK Then
'for multiple images selected
If Not (openFileDialog1.FileNames Is Nothing) Then
Dim i As Integer
For i = 0 To openFileDialog1.FileNames.Length - 1
addImage(openFileDialog1.FileNames(i))
Next i
Else
'for a single image selected
addImage(openFileDialog1.FileName)
End If
End Ifhttp://msdn.microsoft.com/library/de...classtopic.asp btw, VB .NET is not a scripting language, its compiled if you have more questions you can post back and i'll try to check again, i'm not really sure how you want this program to work. is it to get all the images out of a folder or is it letting the user select them?
__________________
I have never let my schooling interfere with my education. -Mark Twain- Xbox live gamertag: melbolt |
|
|
|
|
|
|
#4 | |
|
Hobbyist Programmer
|
Quote:
I'm not sure about scripting, but in VB .NET... Creating the system tray icon is pretty simple. The .NET Framework provides the NotifyIcon class. From the designer, all you need to do is drag a NotifyIcon control to the form. You may also want to design a custom icon to go with it. Strangely, there's no way to go from the icon property on the NotifyIcon object directly to the icon editor. You need to add a new icon file to your project, edit the icon, and then refer to that file to hook it to the NotifyIcon object. now that you have the icon you'll probably want to add contextmenu control to your form as well, this will give you the right click menu in which you can then code to do whatever you want. there's some useful stuff here: http://msdn.microsoft.com/library/de...rp06102002.asp although this is for C#, a lot of it is still similar since they share the .NET framework.
__________________
I have never let my schooling interfere with my education. -Mark Twain- Xbox live gamertag: melbolt |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|