|
I need to be able to restrict which files are displayed in a ListView control according to the file extensions. This was fine until my customer says that they do not display file extensions! Can anyone please let me know if it is possible to get the file extsion from a given PIDL (it won't be in the display name).
|
|
|
|
|
So what if they don't display extensions. The File and FileInfo classes will still retrieve them from the file system when you enumerate the files in a directory. Just put the full path to the file (including the filename) into the Tag property of each ListViewItem.
...unless I've missed something...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for that but the project in question is written in VB6 so .NET classes are unavailable. I have to do things via API calls.
|
|
|
|
|
Same answer, only use the FileSystemObject to get the filenames.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I want to find a record in a Adodb.recordset.
By using Find Method, this statement could not pass:
"ID=3 and Name='Tome'"
And the seek method could not be used for adUseClient.
How to do?
Thanks!
|
|
|
|
|
Try filter. Find in ADO only accepts 1 parameter while in DAO you could have more. Seek is supposed to be its replacement but as you found thats not always suitable. Filter should do what you want.
Jon
|
|
|
|
|
Thank you very much.
Filter is good.
Seek has error. Could you give me an example?
|
|
|
|
|
To set a filter is simple
rs.filter= "myNumberField = " & myNumberVar & ""
The filtered recordset is now a mini recordset which could contain 0,1 or many records based on the filter criteria. When you are done do the following to remove the filter
rs.filter = ""
Jon
|
|
|
|
|
Hi, I am trying to convert a unicode string containing characters with different code page (Basically a set of hex data stored in a string). When I tried to convert them they somehow get mixed up by VB. Does anybody know of a low level way of converting strings to Byte array? I am using VB6 by the way.
Thanks.
SDE
|
|
|
|
|
A quick Google for "VB6 convert string byte array" comes up with:
' Convert string into a byte array:
Dim b() As Byte
b = "This is the String"
' Add null termination:
Redim Preserve b(0 To Ubound(b) + 2) As Byte
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am using vb.net 2005 beta 1.
Thanks!
|
|
|
|
|
That depends on what you mean by "default button". Have you looked at the AcceptButton property of the form?
You also might want to set the TabOrder of the button to 0. But, that depends on what your doing with your form and on what control you want the focus to being at.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i want search/ find text/word in editor using API VB.
I succeded to get 'FindWindow' But after clicking on 'Find'
button no response. I want to jump on matching word/text.
Why this occured ? Does anyone know?
Any help appriciated?
|
|
|
|
|
Uhhhh.... What?
Are you trying to control Notepad or Word? Are you trying to control their Find/Find Next search boxes?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am using 'DHTMLEDIT' control.
i want use FindNext to word/text in 'DHTMLEDIT' like 'Find' used in 'Notepad'.
|
|
|
|
|
You left the most important detail out of your question.
The DHTMLEdit control is so old, MS doesn't even have the docs for it anymore. I've never used the control, so without the docs, I can't tell you how to get it to pop up it's Find window. You might want to consider using a newer component. There's a bunch out there.
But, if you want to keep using this thing, look into finding other examples of people using the control. Just Google for "DHTML Edit Control". You could probably start with this[^] example.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for guidance.
If i use 'Ctrl + F' key then Find Window appear in 'DHTMLedit' control. it search text properly.
Then I think that it is possible using API.
Do you know controls like 'DHTMLedit'?
|
|
|
|
|
abssoft wrote:
Do you know controls like 'DHTMLedit'?
What part of "Just Google for 'DHTML Edit Control'." is difficult to understand?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You mean that you are using the FindWindow API?.
If I have understood correctly, I should tell you that FindWindow API does not find text in a window, it finds the window itself!
It gets the Caption and Class of the window and returns its Handle.
Tell me if I missunderstood you.
|
|
|
|
|
Thanks for Replying
I am using following API -
Private Declare Function FindWindow Lib "User32" Alias "FindWindowA" (ByVal lpClassName As Long, ByVal lpWindowName As Long) As Long
Private Declare Function GetWindow Lib "User32" (ByVal hWnd As Long, ByVal wCmd As Long) As Long
Private Declare Function GetWindowText Lib "User32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
|
|
|
|
|
These functions are used to find any window and return the title bar text of that window. They will NOT help you in finding any text inside a window.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello, I have a treeview in a vb.net application.
I want to collapse nodes except the present one. How I can do this?
I have obtained that some nodes are collapsed, but the present too, and I don't want this.
Thanks
|
|
|
|
|
Can't undetstand ur question.
Explain it detail with code. So that we can help you.
|
|
|
|
|
If have this code:
I want to cross the treeview for when I select one one, collapse the rest (if are expanded), except the branch of the node that are selected
Dim nodo As TreeNode
For Each nodo In CatalogTree.Nodes
If SelNode.IsSelected Then
If Not SelNode Is nodo Then
nodo.Collapse()
End If
End If
Next
When I execute the application, all the tree are collapsed, but I don't want collapse the branch of the node that are selected.
Sorry for my English, I'm for spain.
Thanks
|
|
|
|
|
You've got the right idea, you just need a little more thinking about the problem. You need to do two things.
First, you have to create a list of nodes starting from the currently selected node and working your way back up the tree till you find the root. For each step up the tree, you'll add this node to your list. Use the current node's Parent property.
Second, the code you posted is almost correct. You can then iterate through all the node, and child nodes if your requirements dictate it, and compare it to the nodes in your list. If the node is in the list, DON'T collapse it. If it isn't in the list, well, you know what to do...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|