|
|
how to make a variable that in every hour it makes + 1 in this variable?? ex: now it is 5 pm and in my var there is a number 6. that when 6.pm comes it makes + 1 to var so that it will be num 7. how can i make this??
|
|
|
|
|
Use timer control to do that
1-add timer component
2-set enabled to true
3-set interval to hour 1000 ms=second
in tick event increment the variable
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
i = i + 1
Me.Text = i.ToString()
End Sub
MCAD
|
|
|
|
|
Hi
I need to remove the icon of AN OTHER APPLICATION from the system tray. Is it possible?
Thanks
|
|
|
|
|
Nope. You can't get to it because your app doesn't own it. Besides, you'll only cause the other application to crash. The only way to remove the icon is to shutdown the other app.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello there
I have one thread running parallel to main application. the problem is it takes 100% CPU Usage and I want to assign it say 10 % of the CPU so that in any case system should not go slow.
Can any one guide me how to allocate % CPU Resource to any particular thread. or doing same thing with any application ike MyApplication.exe will take only 10% of the CPU Resource.
|
|
|
|
|
|
|
Hi,
Have you found a solution ?
In Folding@Home you can set max cpu usage in %, but no one has been able to tell me how this is done in vb.net.
|
|
|
|
|
|
I need to do a simple button select from a form to call a MS Word document and a PDF document. I'm new to DotNet so be nice.
|
|
|
|
|
If you just need to open a document, you can simply shell out the command using a commandline similar to this:
Shell("C:\Program Files\Microsoft Office\Office\WINWORD.EXE <mydocument.doc>")
The document must be fully qualified with it's path i.e. "C:\MyDocument.doc" or whatever.
You can do the same for a PDF.
If you need to actually interact with the document, you will have to use the Word Automation model, and your application MUST be compiled against the same version of Word the user has.
Similarly, if you need to interact with a PDF file you will need a full version of Adobe, not just the free reader, and you will have to program against the Adobe API library.
Robert
|
|
|
|
|
I can create a new instance for the MS Office app with the shell statement:
Shell("C:\Program Files\Microsoft Office\Office11\WINWORD.EXE ")
but I can not figure out the proper syntax to call a specific word document in a folder. I have tried the double, triple quotes...
Shell("c:\Documents and Settings\Administrator\My Documents\Docs\Analysis.doc")
I still get file not found in my try catch block
|
|
|
|
|
i am having a problem with the time. i want to see how many hours there were between the first time and the current time. I am making a bit bit game and i want to check the last time that the pet was fed and the distance in hours from that time till current time. i am having a problem with the datediff because if a day passed away, the hours will begin again or with a negative sign before the number. how can i make it that it will keep going on the numbers now restarting on a date.?
|
|
|
|
|
|
|
hummm.. Link Works for me..
|
|
|
|
|
I am have a problem with a custom dll that I have created.
The dll works perfectly until I try to create an installer for an application that uses the dll.
The error that I get when I try to run the installed application is "File or assembly name mycustomdll, or one of its dependencies, was not found"
I think that the issue is that I do not have the public and private keys set for it and that it is not in the global assembly cache.
I got it working by adding the assemblies to the folder where the executable will be placed on the target machine. It does not however seem like this is the best way to do things.
Any suggestions
Any help is greatly appreciated
|
|
|
|
|
You are basically correct. NET locates assemblies by looking in the GAC and the root folder of the application. And you cannot install an assembly to the GAC unless it has a strong name - i.e keys set.
However the decision to install an assembly to the GAC is based on whether you intend to share it with other applications. If you do not intend to use the assembly in any other applications, the best practice is to install it to the app folder.
Robert
|
|
|
|
|
I am going to use it in other applications so it would be helpful to put it in the gac
I have been doing some reading about it but have not been able to make it work.
After I have created the dll the next step is to create the keysets by using
sn -K <filename>
I got this far.
but now what? and where does this file go and how is it used.
Thank you
|
|
|
|
|
Technically, ypou should create a Merge Module setup component for the assembly if you plan to use it accross multiple setups/applications.
But you can also add the shared assembly to the application setup directly.
The basic steps are:
1) Create the shared DLL project, code, compile and sign with a strong key. Then close that solution.
2) Create the EXE project. Add a reference to the compiled release version of the shared DLL, and code the application EXe. Compile the EXE for release and close the solution.
3) Create the Setup Project. Add the compiled release version of the EXE. The IDE will automatically add a dependency reference to the DLL.
4) Change the Folder property of the shared DLL from the default value of Application Folder that was set automatically by the IDE to Global Assembly Cache Folder. Typically you will leave other properties at their defaults.
5) Compile the setup for release and close the solution.
Hope this helps.
Robert
|
|
|
|
|
Thanks Works perfectly
Andrew
|
|
|
|
|
I am doing some work using an ArrayList in VB .Net (I'm new to VB, coming from a C# background) and I am currently without my library of code samples. here is what i am hoping to accomplish. say i have built an arraylist like so:
<br />
Dim arr As ArrayList<br />
arr.Add("a")<br />
arr.Add("b")<br />
arr.Add("c")<br />
arr.Add("d")<br />
arr.Add("e")<br />
arr.Add("a")<br />
arr.Add("e")<br />
arr.Add("a")<br />
<br />
What I am trying to accomplish is to make the array have only one instance of each value, so that once I run this arraylist, the vales would be:
a
b
c
d
e
Any suggestions would be great
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|
|
Here is function that will do the trick.
Private Function DistinctArray(ByVal arr As ArrayList) As ArrayList<br />
Dim x As New ArrayList<br />
Dim myEnumerator As System.Collections.IEnumerator = _<br />
arr.GetEnumerator()<br />
While myEnumerator.MoveNext()<br />
If Not x.Contains(myEnumerator.Current) Then<br />
x.Add(myEnumerator.Current)<br />
End If<br />
'Console.Write(ControlChars.Tab + "{0}", myEnumerator.Current)<br />
End While<br />
Return x<br />
End Function
Here is my test code.
Dim arr As New ArrayList<br />
arr.Add("a")<br />
arr.Add("b")<br />
arr.Add("c")<br />
arr.Add("d")<br />
arr.Add("e")<br />
arr.Add("a")<br />
arr.Add("e")<br />
arr.Add("a")<br />
Dim strValues As String<br />
Dim x As New ArrayList<br />
x = DistinctArray(arr)<br />
Dim myEnumerator As System.Collections.IEnumerator = x.GetEnumerator()<br />
While myEnumerator.MoveNext()<br />
strValues += myEnumerator.Current & ", "<br />
End While<br />
MsgBox(strValues)
"People who never make mistakes, never do anything."
My blog
http://toddsnotsoamazinglife.blogspot.com/
|
|
|
|
|
Awesome! that is Exactly what I needed
Thanks A ton.
______________________
Mr Griffin, eleventy billion is not a number...
|
|
|
|