The easiest way to declare an event with parameters in your control is:
Public Event MyEvent(ByVal sender As Object, ByVal arguments As MyEventArgs)
Of course, you're going to need a class called MyEventArgs that'll hold the parameters you pass to the event subscriber:
Public Class MyEventArgs
' This is not the proper way to do this, but it works for demo purposes...
Public SomeValue As Integer
Public OtherValue As Integer
Public Sub New(ByVal someValue As Integer, ByVal otherValue As Integer)
Me.SomeValue = someValue
Me.OtherValue = otherValue
and, lastly, to raise the event from your control:
RaiseEvent MyEvent(Me, New MyEventArgs(123,321))
Seriously, pick up a book on VB.NET and work through it. Decalring events is covered in just about every book I've seen.
Ifyou google, you'll find something. But, it's very expensive.
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
Adding to CG's post, AFAIK, those programs embed the framework runtime assemblies into a single assembly and loads it when the application runs. What is the problem to install framework which is free ?
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia
There is a tool that generates native code from the IL code in the assemblies, but, you can't just NGEN your assemblies and then distribute those to your customers. NGEN generates code speicifically for the processor that it's running on. So, if you NGEN an assmebly on an Intel Core 2 Duo, the resulting native code isn't guaranteed to work on an AMD Athlon 2600+. NGEN has to be run on the assemblies at installation time on the customer workstations.
Also, don't expect to get large performance boosts in load times. When an assembly is loaded, the native compiler does a very good job at compiling the code down to native and does it very fast. The .NET CLR will also not compile an entire assembly, but only what it needs to compile to run the current code. If you create an instance of a class in, say, a .DLL, that class won't get compiled into native code until your code first tries to create an instance of the class. The compiler works on a on-demand basis.
Now, if you go the other route and use an expesive third party product to build the .NET Framework into your .EXE, you still have an IL .EXE which will be compiled on-demand, but now you have a MUCH larger .EXE file, which will take longer to load anyway.
The registry is NOT the same for every user. Specifically, the registry has sections that are specific to the machine, and therefore any user that logs in on that machine, and sections that are specific to each user. The vast majority of the registry sits under the HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER hives. I think you can figure out which is which from those two names alone. Obviously, any value you create under HKEY_CURRENT_USER is not going to be visible to any other user who logs in on that machine.
thank for u for replying me ..
its so help ful to me ...
but i got an error while doing it ....
i have two user
i m developing my project in "adminstrator"
and i written the code like this ...
Dim usrky As RegistryKey
usrky = Registry.LocalMachine
If (usrky.OpenSubKey("Software\VIJAY")) Is Nothing Then
usrky.OpenSubKey("Software", True).CreateSubKey("VIJAY").SetValue("me", "pandu")
MessageBox.Show(usrky.OpenSubKey("Software\VIJAY", 1, AccessControl.RegistryRights.FullControl).GetValue("me").ToString(), "local machine key reg")
its working in adminstrator but ...
it is not working in user "myuser"
it is giving error like
"Register Access is not allowed"
now what to do ....
my project has to be run under both "administrator" and "myuser" also.
There's your first mistake. Always develop your applications as the user, not the admin. Admin's have far mar permissions to the system than normal users do. You've just found out why this is a good idea.
The reason is doesn't work is because Admin users have full access to the registry, including full read/write permissions to everything under the HKEY_LOCAL_MACHINE hive. Users only have read access to HKEY_LOCAL_MACHINE. That's why it doesn't work. You're going to have to find another place to store your data if normal users are going to write to it.
and also please you may double check my code..
here it is..
Public crxApp As CRAXDRT.Application
Public crxReport As CRAXDRT.Report
Public crxDataBase As CRAXDRT.Database
Public crxTable As CRAXDRT.DatabaseTable
Public crxTables As CRAXDRT.DatabaseTables
Public crxConnectionProperty As CRAXDRT.ConnectionProperty
Public strSelectionfrm As String
Public strCRSourcePath As String