|
ja with the first 1: my problems are rare... most of the times it works.. but it's like the WMI on the remote computer gets clogged up from the previous attempts (when i ran the program before)
it's funny - i changed the password on the remote comp and now with threads i get an UnauthorizedAccessException sometimes..
NE Ways il let u know wat happens
|
|
|
|
|
hi - thread pool still gives me problems.. um i dont wanna worry about threads atm.. rather, plz could u just use the connect (no threads) and run the exe in the debug folder at the same time.. i would like to know if u also get and RPC error? if u dont get one at first, just keep running the program and exe thanks..
Another thing-do u know how to pass Credentials to be able to access the registry? Im using RegistryKey and OpenRemoteBaseKey...
thanks again
|
|
|
|
|
Okay. Now I’m making some progress. Thanks, beowulfagate, for suggesting the GetThumbnailImage method.
Can anybody tell me how to use the GetThumbnailImage method to fill a ListView?
Here is what I have:
lstPhotos.BeginUpdate()<br />
lstPhotos.Items.Clear()<br />
Dim strFiles() As String<br />
Dim x As Integer<br />
strFiles = Directory.GetFiles(formLibrary.componentPath)<br />
For x = 0 To strFiles.Length - 1<br />
Dim objListViewItem As New ListViewItem<br />
Dim imageThumb As Image<br />
With objListViewItem<br />
.Text = Path.GetFileName(strFiles(x))<br />
.SubItems.Add(Format(FileLen((strFiles(x))), "###,###,###,###"))<br />
.SubItems.Add(CStr(File.GetLastWriteTime(strFiles(x))))<br />
End With<br />
lstPhotos.Items.Add(objListViewItem)<br />
<br />
Next x<br />
lstPhotos.EndUpdate()
This lists the contents of the formLibrary.componentPath folder but I can't see how to use GetThumbnailImage to display the images as thumbnails in lstPhotos .
Thanks.
Brad
|
|
|
|
|
...I'm waayyy off aren't I?
The more I dig, the more I realize that I have no idea what I'm doing.
I wonder if I should try to use the StateImageList property?
Can anybody help?
Brad
|
|
|
|
|
try this:
<br />
dim imagethumb as image<br />
imagethumb.fromfile=path.getfilename(strFiles(x))<br />
dim index as integer=lstphotos.largeimagelist.images.add(imagethumb.getThumbNailImage)<br />
lstphotos.items.add(path.getfilename(strFiles(x),index)<br />
Note: the listview should be in the LargeIcons Style to use the LargeImageList. Use the SmallIcons to use the SmallImageList.
|
|
|
|
|
I can’t get imagethumb.fromfile to work. It says: Overload resolution failed because no accessible ‘FromFile’ accepts this number of arguments.
At first I thought that this might be because strFiles is and array but that didn’t seem to be causing the problem.
|
|
|
|
|
Uh Oh! Sorry. Try this.
<br />
Imagethumb.fromfile(path.getfilename(strFiles(x))<br />
|
|
|
|
|
That did the trick. Thanks!
Now the Index variable is giving me a fit.
Dim index As Integer = lstPhotos.LargeImageList.Images.Add(imagethumb.GetThumbnailImage )
Should index be declared as something other than an Integer since an image is being assigned to it? Is so, do you know what it would be?
Thanks
Brad
|
|
|
|
|
No, it is not an image being assigned to it. It is the index of the image we just added to the imagelist. We need this index to know what index goes with what item. The add method of the ImageCollection Class is declared as:
<br />
public sub overloads Add(icon)<br />
public sub overloads Add(Image) 'We are using this<br />
public function overloads Add(Image,Color) as integer 'When we should be using this<br />
Just add a color parameter to the Add method and it should work fine. Look it up in the MSDN Library.
|
|
|
|
|
Thanks.
I think I'm on track now.
Brad
|
|
|
|
|
Trying to find some basic programming help = adding icons to menus and changing the background color of menus. Have seen this done but can't find any examples.
Found one reference on this site "Adding Icons to Menus" by Willian.BR but apparantly it is a broken link.
Any suggestions or help appreciated!
billp@awalnet.net.sa
|
|
|
|
|
It can be done, but not within VB6 code. See the following articles and projects for helper .DLL's that will do what you want, especially the first one.
Yahoo Search Results[^]
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi
i have tried to add a track bar control to my project, in vb.net, using the code provided by the msdn, however, it doesnt seem to work, it is not accepting the values nor is it saving them back to the xml file
any ideas?
|
|
|
|
|
if you are using the application.config.xml with the property, it wont write to the file. It will only read from the file when you load the application. You can manually change the XML file for it to change the value.
Hope it help.
anghp@yahoo.com
Feel free to email or yahoo messenger.
|
|
|
|
|
actually i am using the writeXml after each addition, and the problem is i want the user to make the changes.
this is not working with the add/delete buttons as well... as i can view the temporary changes however it is not changing the actual xml file
|
|
|
|
|
Okay, I was thinking about making a kind of media player in Visual Basic .NET that I could call my own...but the problem was I don't know how to insert a control that let a user control the sound! I would be able to in VB6 maybe, but .NET isn't the same. Could someone pleeeeeease help?
|
|
|
|
|
If you want to insert a control (activeX perhaps), right click at the toolbar, select add/remove items then select comp object.
Hope that is what you want.
anghp@yahoo.com
feel free to email or yahoo messenger.
|
|
|
|
|
This is the code, just paste it into a form with 1 command button.
Declare Function PlaySound Lib "winmm.dll" Alias "PlaySoundA" (ByVal lpszName As String, ByVal hModule As Long, ByVal dwFlags As Long) As Long
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim media As OpenFileDialog = New OpenFileDialog
media.RestoreDirectory = True
If media.ShowDialog = DialogResult.OK Then
Dim waveFile As String = media.FileName
Dim extension As String = System.IO.Path.GetExtension(waveFile)
If (extension.ToLower() = ".wav") Then
PlaySound(waveFile, 0, &H8)
End If
End If
End Sub
hope that help.
anghp@yahoo.com
Feel free to email or yahoo messenger.
|
|
|
|
|
Guyz,
I remember working with C++ COM, I could use QueryInterface to find whether an interface is supported in a component. Is there a similar mechanism in VB too? If not what would be a best way to do.
Thnx!
|
|
|
|
|
You could use the "IF TYPEOF objectname IS objecttype" statement in VB.NET to determine if a component supports a given interface.
|
|
|
|
|
A better method (object orientated etc.) would be to use IsInstanceOf e.g. to find out if MyObject implements the interface IMyInterface use the following code.
GetType(IMyInterface).IsInstanceOfType(MyObject)
|
|
|
|
|
Can anybody suggest a good way to display images in a directory? I would like to be able to display a small (thumbnail) view of the image and then click on the image to open it up in a PictureBox.
I’ve been trying to create a ‘Windows Explorer’ type setup where images in the directory that is open in a TreeView would be displayed as thumb nails. Since I’ve had no luck with that, I’m trying to re-group and find a different way to display the images.
Thanks
Brad
|
|
|
|
|
I suggest you use the Image Class provided by the .Net framework. It has a GetThumbnailImage method the you can use to display thumbnail images. Good Luck!
|
|
|
|
|
I have two listbox controls on the same form that I have populated using an arraylist created from an xml file. When I execute the form, the information appears in the list boxes as it should; however, when I make a selection in one of the list boxes, the selected value in the other changes.
Also, When I go to print out the selected values using:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Label3.Text = "Creating Test For " & ListBox1.SelectedValue _
& ":" & ListBox2.SelectedValue & ". Please Wait..."
Label3.Visible = True
End Sub
I get the selected value of the Listbox2 in both inserted places.
When I created these on the form I did not copy paste one from the other, I dragged two new listboxes onto the windows form.
Other things to note. I did populate the two listboxes using the same arraylist object after clearing it using:
xmlDoc.Load("../xml/BatchConfig.xml")
xmlNdList = xmlDoc.GetElementsByTagName("Unit")
For i = 0 To xmlNdList.Count - 1
arlAL.Add(xmlNdList.Item(i).Attributes("Id").Value)
Next
ListBox1.DataSource = arlAL
arlAL.Clear()
xmlNdList = xmlDoc.GetElementsByTagName("Phase")
For i = 0 To xmlNdList.Count - 1
arlAL.Add(xmlNdList.Item(i).Attributes("Id").Value)
Next
ListBox2.DataSource = arlAL
What gives?
|
|
|
|
|
What you did was bind ListBox1 to a datasource, then you cleared out that datasource and entered new information into it. So, yes, both istBoxes will have the same information behind them. The information from a datasource is not copied into the listbox, it is BOUND.
The solution is to create to diferent arrays and bind them to their respective listboxes.
'I'm assuming you Dim'd an ArrayList as arlAL...
Dim arlAL1 As New ArrayList()
Dim arlAL2 As New ArrayList()
xmlDoc.Load("../xml/BatchConfig.xml")
xmlNdList = xmlDoc.GetElementsByTagName("Unit")
For i = 0 To xmlNdList.Count - 1
arlAL1.Add(xmlNdList.Item(i).Attributes("Id").Value)
Next
ListBox1.DataSource = arlAL1
xmlNdList = xmlDoc.GetElementsByTagName("Phase")
For i = 0 To xmlNdList.Count - 1
arlAL2.Add(xmlNdList.Item(i).Attributes("Id").Value)
Next
ListBox2.DataSource = arlAL2
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|