|
k...
so I'm glad that this has worked for you on your side... currently I must be looking at only the filename and not the fullpath as I get an error stating the file cant be found....multiselect is off and the only reason for the doubleclick is becuase I expect to have massive txt files that I don't want displaying everytime a user hovers over the filename(and I wanted to simulate the process for doubleclicking to open a filefolder,etc, as the expected audience won't understand the single click ).
Good catch on the SelectedItems(0) I removed that from an earlier sub becauase it was restricting me to only the first listing, and I forgot to put it here(was assumeing the same would happen... )
The confussion re: the "Tag" was because the editor didn't like the use of 'tag' and that was the error it gave in response to Dave's code
Currently the ListView shows the entire filepath as I was just showing filename, had the same probs having now and used fullpath to test....never changed it.
re: rebuilding paths for executing commands....I can't even get the node text to show in a textbox....I'm feeling like I'm missing the biggest part of my day, like I walked out side with no pants on or something.... why don't they have a "Brain Fart" icon smiley face?
Dim Beautiful As String
Beautiful = "ignorant"
Label1.Text = "The world is full of " & Beautiful & " people."
Why is common sense such an un-common comodity?
|
|
|
|
|
wetrivrrat wrote:
The confussion re: the "Tag" was because the editor didn't like the use of 'tag' and that was the error it gave in response to Dave's code
Yeah, I can't see a 'Tag' property, although I didn't look too closely, the (0) was obviously a major part of your problem, inserting it could well make Dave's code work.
wetrivrrat wrote:
re: rebuilding paths for executing commands....I can't even get the node text to show in a textbox....
How do you mean ? Is this a new question ?
If file names are unique and you don't want to show them, you can hide them in the listbox, or you can build a filename->filePath hashtable before you show the list.
wetrivrrat wrote:
I'm feeling like I'm missing the biggest part of my day, like I walked out side with no pants on or something....
LOL - I feel like that all the time....
wetrivrrat wrote:
why don't they have a "Brain Fart" icon smiley face?
Obscenity laws. :P
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
YES!!!! ok, so the problem was because I had mulitselect disable and was not telling the code to look for a path... insert dave's 'tag' and your '(0)' and I feel like I at least have found my shorts, even if they were in the MAILBOX! thanks so much!!!
k.. so, this fixed the 'tag' problem, and the node title in the textbox...(which wasn't a new question, but rather just a statement...an additon to my delima, sorta)...
again thanks
till next time.......
"To all the beautiful people...including myself...."
Dim Beautiful As String
Beautiful = "ignorant"
Label1.Text = "The world is full of " & Beautiful & " people."
Why is common sense such an un-common comodity?
|
|
|
|
|
No worries, glad to help.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
My bad. That's what happens when I try to write code from memory. Christian's right. The doubleclick handler should look like this:
Private Sub ListView1_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.DoubleClick
Try
System.Diagnostics.Process.Start(ListView1.SelectedItems(0).Tag)
Catch ex As Exception
MsgBox(Err.Description, vbCritical, "Error " & CStr(Err.Number))
End Try
End Sub
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Yeah, and from the mistake I posted, it looks like I went to sleep right before I started writing the post!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
LOL
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi I need to create program to connect my VB.NET to MS Outlook and import all messages to database (Access). Does anybody know how to do it. Thanks
|
|
|
|
|
Depends on your version of Outlook. If your using Office XP and above, check out the MS Office XP Primary InterOp Assembelies.
hope this helps.
|
|
|
|
|
I am trying to develop a new usercontrol that has a default image I need to load. I have an embedded bitmap and using the following code to retrieve it.
Dim executing_assembly As System.Reflection.Assembly = Me.GetType.Assembly.GetEntryAssembly()
' Get our namespace.
Dim my_namespace As String = executing_assembly.GetName().Name.ToString()
' Load three pictures.
Dim picture_stream As Stream
Dim bm As Bitmap
picture_stream = executing_assembly.GetManifestResourceStream(my_namespace + ".Checked.bmp")
If Not (picture_stream Is Nothing) Then
bm = New Bitmap(picture_stream)
picturebox.Image = bm
picture_stream.Close()
End If
When i reference my control(dll) and try to use it in another app. it does not work all i get is Object Reference not set to an instance of an object.
But when i use the code by its self in another project it works.
What it boils down to is how can i store/embed an image in a usercontrol dll.
Thanks in advance.
Mark Thibodeaux
|
|
|
|
|
tibmark wrote:
Dim my_namespace As String = executing_assembly.GetName().Name.ToString()
The executing assembly is not the same as the dll, if the code is in a dll. You'll need to get the name that's required for your dll, either by a different method, or by hard coding it.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I was wrong it comes back null is not a valid vaue for stream. i am fairly new to the creation of usercontrols any examples would be very helpful.
Mark Thibodeaux
|
|
|
|
|
Usercontrols have nothing to do with it. You've obviously copy and pasted this code, do you have any idea what it does ? Resources are stored in your file and retrieved using a fully qualified name. You're building the name by asking what the name of the application that is running is, but that's not the name being used in your dll, which has a different name. Have a look at the string that's being generated, and then replace the application name with the dll name, that should work. I've never pulled resources from a dll before, but I'd imagine that would be the way forward.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Yes that is what i did, i couldnt find the rigght info just code. So let me ask the question the right way i would like to make a usercontrol that hosts a few bitmap images. what is the best way to do this or can you point me in the right direction. I am doing what i can to learn on limited resources and no real experience.
Mark Thibodeaux
|
|
|
|
|
Easiest approach - why not just load the files from disc ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i'm not looking for the easy way out. i want the images to load when i use the control on any app.
Mark Thibodeaux
|
|
|
|
|
|
I think this will help. I understand what you were talking about. Thank you for your patience and help. I need all that I can get.
By the way any tips to gaining knowledge and experience would be very appreciated.
Thanks again.
Mark Thibodeaux
|
|
|
|
|
tibmark wrote:
Thank you for your patience and help.
To be honest, I was just thinking that I've been neither patient, nor helpful Normally, I'd whip up a project to work out the definitive answer, but I'm under a little schedule pressure today, and still trying to keep my batting average up.
tibmark wrote:
By the way any tips to gaining knowledge and experience would be very appreciated.
What's worked for me is to always learn why things do what they do, find a code sample and then use MSDN to nut it out, ask lots of questions in places like this one, and invest in good books, which I read at least twice. I nearly fell over today, I was away sick and some orders come in, I got two books, both over 800 pages, and one > 1000. I had no idea they were so big ( they are both ASP.NET, one on security and one on improving performance ). I've got a lot of reading to do....
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Don't know if 've understoog your application but why don't you use an Imagelist to store and load images. It's easy to access and use.
|
|
|
|
|
i want to make a custom checkbox that uses several predefined bitmaps. how and where do i store the images and call them. i want to be able to use in any project. i have come close but the project i want to use it in has to be add to the usercontrol solution or it will not work.
Mark Thibodeaux
|
|
|
|
|
I bound some textboxes to a well-defined datatable. By well-defined I mean I created each columnn of the table manually and defined the dataTypes of each column.
If I try enter in non-Date data into one of the textBoxes bound to DateTime Column, the original date value gets reverted once I change focus. This is GRRRREEAT! but how do I alert the user on why this has happened. I need to somehow intercept this event.
|
|
|
|
|
someone please send me an article/link to one on validating data entry controls for vb.net forms.
I have an application with 5 different developers working on their own forms. The challenge is to create some sort of base class that will force the developers to use the same validation controls and or regular expressions on string textboxes, date textboxes, integers and so forth.
|
|
|
|
|
|
I am an experienced VB.NET programmer who has a 13 year old son who wants to learn to program during the summer. Having been homeschooled for several years he is good at independent learning. Does anyone have any good recommendations for books, web-based classes, video tutorials, etc. that do a good job of teaching beginning programming using VB.NET? He could study it during the day, and then I could tutor him after I get home from work. FYI, he is an A student and learns quickly.
Mark Kettlewell
|
|
|
|