|
If you switch to code view, just above the window you'll find two dropdown boxes next to each other. Pick the control you want to handle an event for in the left side box, then pick the event/method/property you want to handle/override in the right side box. This will automatically create an empty event handler in your code, complete with the correct event header.
You can also do the same thing with the Property window. Near the top of that window there is a small button with a little yellow lightning bolt in it. If it doesn't show up, click on the control you want in the designer, or pick it from the dropdown list just above the Properties window. When you click on that lightning bolt, the Properties window will switch to showing all the events exposed by that control. Find the event you want, then double-click in the white box to it's right and it'll create an empty event handler for you.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Great! I found it in the code view. Now that I know where it exists I'm in business.
I don't see the lighting in the properties page. I'm used to using it all the time in c++, but I don't see it in Visual Basic. In fact, since I'm used to it in c++, this was the place I was looking.
Never mind, so long as I know it exists in the code view, I'm in business. It does the dirty work of building the proper templates so they are right the first time around.
Thanks again,
Ilan
|
|
|
|
|
|
I wanted to reinvent the wheel only enough to learn how to do something should I have to do so. Thus I tried Dave's suggestion to get a feel for things.
Enough reinventing the wheel, and I will have a longer look at the ZedGraph. Presently it seems I have NET 1.1 so I can't use the latest version 5.0. (I have Visual Studio 2003 and don't want to update just for this.)
Thanks,
Ilan
|
|
|
|
|
As you are most probably already aware, but I wasn't certain so I thought I would just say, you can download version 4.3.5 from the SourceForge project site[^] which works with .NET 1.1.
|
|
|
|
|
Alex,
I am really impressed. I want to thank you for pointing out the code to me. I was just thinking of making a simple graph with some text and wanted to avoid reinventing the wheel.
This isn't a wheel but the whole automobile! I see I can use it in c++, so I'll use it there as well.
My trivial question in Visual Basic turned out to a super answer.
Ilan
|
|
|
|
|
Hi guys,
I'm currently working on how to lock or at least hide a certain folder,
below are the codes that i'm tryin to use...
renameFileName = (InputBox("Folder Name:", "Unlock", "Cycle #"))
System.IO.Directory.Move(path & "\.{20D04FE0-3AEA-1069-A2D8-08002B30309D}", path & "\" & renameFileName)
thing is, its working on my local folders, but when i used it to a folder on a mapped drive its just renaming it, and i still can access the folder...
if you guys got another approach on how to do this...
tnx in advance.
-::maximus::-
|
|
|
|
|
That won't work on network drives. The only way to hide folders on a network is using Access Control Lists and assign the appropriate permissions to users/groups. Exactly how this is done depends on your network O/S.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
|
Uhh, you do realize that link is for the Team Foundation Server Source Control, right?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Guys,
Do you know of any forum (publication) where I can get some information on how to I can incorporate an exe or dll in custon setup in VB.NET. I want to include a form that should prompt for User_ID and Password during setup. Most of the examples I have seen are in C#.
Regards,
manv
|
|
|
|
|
Those examples are easily convertable to VB.NET. If you look at any example code on MSDN, there are usually code samples in both VB.NET and C#. You couldn't ask for a better Rosetta stone to show you how to translate between the two.
If you want, you can also copy/paste code snippets into an on-line translator, like this one[^]. The only problem with using these is that not one of them can do a perfect job of translating the code. They can come close though...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Well, am comfortable of course with conversions from C# to VB. However may be I havent found a good example. Do you know of any example using a dll or exe in custom action, you can just give me the link.
manv
|
|
|
|
|
I don't know of any examples. I can't release what I've done to you because I don't use Visual Studio's Setup projects. I'm using Wise for Windows Installer.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I'd like to know how to detect an USB Device if it's plugged in, so if the user for example, plugs his MP3-player in the program pops up, and shows the drive letter of the Usb device. Anyone?
--Zaegra--
|
|
|
|
|
There's just WAY too much information to cover on how to do USB in a forum environment. You can learn a lot, though, from checking out the article and code samples in this[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
I am using grid in my window form.I have 2 problem.
1)how to save image in sql database
2)How to show image in grid
I hope you help me.
Regards,
Nagraj
|
|
|
|
|
if i'm having the JobID of current printing document
how can i get the Printer name which is printing that?
code pls
"You can do any thing you set to your mind" - theGhost_k8
|
|
|
|
|
How are you getting the JobId? The job is stored in the queue of the printer printing it. There is no "one" job that is the current job, because you can have multiple printers, each printing it's own "current job" at the same time.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
well i;m actually using printing component that generates event.
Problem with it is i've created 2 saperate app. with diff. printer names(same Component)
thus i'm getting the jobid. but prob. is that compo. raises event in both proj.. so i want to identify printer name(printer_app1 or Printer_app2) using jobid
if doc is printed using printer_app1 then
exit from app2's event and conti. app1's event and vice versa..
well i've got some ways out there that includes WMI, API(get job) etc..
but in that i'm not able to get rid of the error
"An unhandled exception of type 'System.ExecutionEngineException' occurred in system.management.dll"
and i'm not able to retrive details from api... i've searched through net explaining uses and etc but i cant complete that using api...
http://www.merrioncomputing.com/Programming/PrintJob.htm
well i'd aspecting if u can post some code ...
--thanks
"You can do any thing you set to your mind" - theGhost_k8
|
|
|
|
|
Kedar V wrote: but prob. is that compo. raises event in both proj
Of course it is! A print job was started; it doesn't matter which app started it. It'll raise that event in your apps if Notepad printed something.
Kedar V wrote: WMI, API(get job) etc.. but in that i'm not able to get rid of the error
"An unhandled exception of type 'System.ExecutionEngineException' occurred in system.management.dll"
What's the code you're using to get the WMI data for this job?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dim oq As System.Management.ObjectQuery = New System.Management.ObjectQuery("SELECT * FROM Win32_PrintJob")
Dim query1 As ManagementObjectSearcher = New ManagementObjectSearcher("SELECT * FROM Win32_PrintJob")
Dim queryCollection1 As ManagementObjectCollection = query1.Get()
For Each mo As ManagementObject In queryCollection1
MsgBox(mo.Item("Document").ToString())
"You can do any thing you set to your mind" - theGhost_k8
|
|
|
|
|
If you're using Windows 2000, the problem appears to be fixed with a Hotfix. Read more here[^].
In Windows XP, it appears to be fixed with SP2. Click[^].
This second article pre-dates the one above, so I couldn't tell you if this thing will actually work yet.
My Windows 2000 machine needs to be patched up to the latest and I think my XP machine is a couple updates behind. I'll let you know if it works on either.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Well, it works on Windows 2000, so long as the machine filling the query has all the lastest updates from WindowsUpdate.
For XP, you'll have to wait 'till I get home to try that one out. But, it's probably going to be the same thing... all the latest updates.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Oh! Might help if I posted the code I'm using:
Imports System.Management
Public Class Form1
' Important!! MUST use \root\cimv2 here! \root\default does NOT work!
Private scope as New ManagementScope(String.Format("\\{0}\root\cimv2", Environment.MachineName))
Private Sub Button1_Click(blah, blah) Handles Button1.Click
If ConnectToWmi() Then
GetJobList()
End If
End Sub
Private Sub GetJobList()
' Clear out the ListView we're using to show the jobs.
JobList.Items.Clear()
If scope.IsConnected Then
Dim query As New ObjectQuery("SELECT * FROM Win32_PrintJob")
Dim searcher As New ManagementObjectSearcher(scope, query)
Dim objectCollection As ManagementObjectCollection = searcher.Get()
For Each obj As ManagementObject In objectCollection
JobList.Items.Add( new String() { CUint(obj("JobId")).ToString(), CStr(obj("Document")) } )
Next
' It's very important to dispose these objects when your done with them! If
' you don't, you'll end up with a handle leak and eventually crash the system.
objectCollection.Dispose()
searcher.Dispose()
End If
End Sub
Private Function ConnectToWmi() As Boolean
scope.Connect()
Return scope.IsConnected()
End Function
End Class
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|