|
Oh, this is VB6 ? Then I have no idea.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I can't really understand what your talking about. But, it seems liek you want to change the mouse cursor when it is over your images?? I think you're looking for the MousePointer property, not MouseIcon .
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
yes yes but how can i change the image in the Mousepointer property???? cause i cant found the "Hand" image
|
|
|
|
|
VB6 doesn't support it. It only supports the cursors found here[^], plus a custom cursor.
You'll have to to make your own icon of the hand cursor, load it into the MouseIcon property with LoadPicture , then set the MousePointer property to vbCustom , or the integer 99.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have create a watch folder object to c:\temp,
but something, the create event is fired when the large file is not completed.
Is there any existing method of other event to get the event when the document is completed?
|
|
|
|
|
I take it your talking about the FileSystemWatcher. No, there is no event that syas the file has been completely written to and closed. It's impossible to track.
The generally accepted work-around is to catch the File Created event, then try opening the file with exclusive access (DenyShare...). When you're finally able to open the file, the other application should be done writing to it. There are exceptions to this, but it depends on the application that's writing the file.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
In my case, I have a file placed on a file server,
I can set the permission about the folder/file.
How can I let the user can read the file in the application I create but they cannot direct access the file out of my application?
|
|
|
|
|
You have to wrap your file access code in some user impersonation code.
|
|
|
|
|
The only way I can see is to encrypt it so only your code can make sense of it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
You can't do that. If you give a user permission to open that file, they can open it using anything, including Notepad or some file byte editor. You're only solution, like Christian said, is to encrypt the file so it can't be understood by anything other that your application.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Is it possible to connect or print file in a thermal printer using VB .net?
if it is possible, How to connect or print file/documents in a thermal printer. this printer is a network printer. I've been searching a quit long time but i did not find any article that is related to my problem.
Thanks!
|
|
|
|
|
A printer is a printer, your driver handles communucation to it, no matter how it prints. Any printing tutorial should work, you just need to install it as a network printer on the PC running your program.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
I am looking into programming a system information tool as part of a application suite, which I am currently having problems with. At the moment, I have been reading up on the aspects of the WMI at the MSDN section over at Microsoft.
I am wondering if anyone has any example code on making a query as the System.Management doesn't seem to be able to be referenced from the project properties screen and cant't use the Imports System.Management bit of code to include it.
Any help would be greatly appreciated.
Thanks, Andrew Robinson.
|
|
|
|
|
First you need to reference System.Management.dll
Here is some code for retrieving NT Users and NT Groups
Imports System.Management 'Need to reference System.Management.dll<br />
<br />
<br />
Public Module NTDomain<br />
<br />
Public Function GetNTUsers(ByVal NTDomain As String) As DataTable 'This function uses System.Management namespace<br />
Dim dtNTUsers As New DataTable<br />
With dtNTUsers<br />
.Columns.Add(New DataColumn("FullName"))<br />
.Columns.Add(New DataColumn("Name"))<br />
.Columns.Add(New DataColumn("Domain"))<br />
.Columns.Add(New DataColumn("LocalAccount"))<br />
<br />
Try<br />
Dim searcher As New ManagementObjectSearcher( _<br />
"\\" & NTDomain & "\root\CIMV2", _<br />
"SELECT * FROM Win32_UserAccount")<br />
<br />
Dim en As System.Management.ManagementObjectCollection.ManagementObjectEnumerator = searcher.Get.GetEnumerator<br />
While en.MoveNext<br />
Dim queryObj As ManagementObject = en.Current<br />
Dim dr As DataRow<br />
dr = .NewRow<br />
dr("FullName") = queryObj("FullName")<br />
dr("Name") = queryObj("Name")<br />
dr("Domain") = queryObj("Domain")<br />
dr("LocalAccount") = queryObj("LocalAccount")<br />
.Rows.Add(dr)<br />
End While<br />
.AcceptChanges()<br />
Catch ex As System.Exception<br />
Throw New PDM.DBA.GetNTUserListException<br />
Finally<br />
Dim drUser As DataRow<br />
drUser = .NewRow<br />
End Try<br />
Return dtNTUsers<br />
End With<br />
End Function<br />
<br />
Public Function GetNTGroups(ByVal NTDomain As String) As DataTable 'This function uses System.Management namespace<br />
<br />
Dim searcher As New ManagementObjectSearcher( _<br />
"\\" & NTDomain & "\root\CIMV2", _<br />
"SELECT * FROM Win32_AccountSID")<br />
<br />
Dim dtNTGroups As New DataTable<br />
With dtNTGroups<br />
.Columns.Add(New DataColumn("Type"))<br />
.Columns.Add(New DataColumn("Name"))<br />
Dim en As System.Management.ManagementObjectCollection.ManagementObjectEnumerator = searcher.Get.GetEnumerator()<br />
While en.MoveNext<br />
Dim queryObj As ManagementObject = en.Current<br />
Dim sSplit() As String = Split(queryObj("Element"), ",")<br />
Dim sType As String<br />
<br />
If sSplit(0).Contains("Win32_Group") Then<br />
sType = "Group"<br />
ElseIf sSplit(0).Contains("Win32_SystemAccount") Then<br />
sType = "System Account"<br />
ElseIf sSplit(0).Contains("Win32_UserAccount") Then<br />
sType = "User"<br />
Else<br />
sType = "Unknown"<br />
End If<br />
<br />
sSplit(1) = Replace(sSplit(1), "Name=", "")<br />
sSplit(1) = Replace(sSplit(1), """", "")<br />
<br />
Dim dr As DataRow<br />
dr = .NewRow<br />
dr("Type") = sType<br />
dr("Name") = queryObj("Element")<br />
.Rows.Add(dr)<br />
End While<br />
.AcceptChanges()<br />
End With<br />
Return dtNTGroups<br />
End Function<br />
<br />
End Module
Hope this helps, took me a while to sort this out as well.
Regards
Steve Jowett
|
|
|
|
|
could someone please help me with searching for items displayed in a listview. i want to be able to search by surname or name. that once i search, the listview automatically collapses to show the name that corresponds to the search typed in the search textbox.
-- modified at 18:41 Tuesday 22nd August, 2006
|
|
|
|
|
You need to iterate over your items and search them.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I have a form that is set to have an icon appear in the upper left hand corner of the title bar. I made the icon in Visual Studio 2005. It looks just fine on my machine (which runs windows 2000) but I've tried it on an XP machine and it has that default icon picture....I am guessing that I need to make another Icon Type in my icon to get it to work, but I don't know what type XP requires. Does anyone know if this is in fact my problem, and/or what type of icon I need to create? I am currently using a 16 by 16 with 16 bit color.
|
|
|
|
|
i wanted to clarify something
whats teh difference between public,private and static variables?
my idea is that static variables can be changes anywhere in the program and once it has change the change is reflected throughtout the program and i think thats the same for public
but thinking about an example if a variable is defined as static in one function and is pass to another function and value is changed will the value be changed in the previous function.i think so............as for the public i dont think the value change will be reflected in the previous program
kenny
|
|
|
|
|
First of all, if you want to be a programmer, learn to use google.
public - this variable/method is visible to anyone
protected - this variable/method is visible to this class, and classes derived from it
private - this variable/method is visible to this class only
private and protected are used for encapsulation, so a class can hide it's internal details and expose only a public interface.
static is completely unrelated. If a method is static, it has no state, you cannot use this, or any member variables in that method. Factory methods are one example of a method that will be static. A variable that is static means it only exists once. If you have 50 instances of foo, and bar is a static int, if you change it in one instance, that value is set for all instances.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
A static variable is created in the class. That means that it's available even if you don't have any instances of the class. Also if you have ten instances of the class, there is still only one of the static variable.
Variables that are non-static are created in the instance of the class. If you create ten instances, each will have their own set of variables.
Private variables are only reachable from within the same class, while public variables are also reachable from outside the class.
OOP purists never use public variables. Instead they (we) declare them as private, and create a public property to access each variable.
---
b { font-weight: normal; }
|
|
|
|
|
Hi All,
I want to write some program that control windows behavior, like hiding the desktop, disabling Ctrl+Alt+Delete, Hide Start Menu, and all this stuff, how can i make it under .NET
and plz give me a detailed answer coz am new to this field
thanks in advance
|
|
|
|
|
You don't. This is all controlled using Group Policies. Get the Windows XP Resource kit and you'll find all this stuff documented.
BTW, you can't disable Ctrl-Alt-Delete. You CAN, however, disable the stuff in the box that shows up. Again, all controlled through policies.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Well, so can i edit this policies -i mean in the group policy- through programming, i know that i can reach this stuff through MMC and then editing the policies throught the MMC wizards, but can i have my own wizards which do the same???
thanks for ur answer
|
|
|
|
|
You could, but why reinvent the wheel?
The policies are mostly just registry entries and controlling security on those entries. The code to manipulate the registry and security is not that hard. The hard part, and very tedious, is figuring out what registry entries to change and what values to put into them. Again, all documented in the Windows XP Resource Kit.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
if a computer does not have access installed can you still run a vb.net program using a microsoft access database?
dbellman
dbellman@bellmanware.com
|
|
|
|