|
Have you tried something like a MessageBox to show you what it returns?
Private Sub Form1_Load(blah, blah) blah
MsgBox(Application.StartupPath)
End Sub
Combining it with another directory or filename is easy:
Imports System.Io
.
.
.
Dim myFilePath As String
myFilePath = Path.Combine(Application.StartupPath, "myFileName.txt")
MsgBox(myFilePath)
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
how could i implement certain searching algo into my application such as boyer moore algo.could sumbody help.
|
|
|
|
|
what is the best or easiest way to lower the amount of memory that a program uses?
- Kyle
|
|
|
|
|
Rewrite the app to be most efficient.
Other than that, you can temporarily lower the memory requirements, but it'll creep back up while you use your application. The CLR does a very good job at managing memory.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Is there a command that will close a program and all its forms. Right now i have a program that wont close when all the forms are gone. I am using this code to switch from form to form:
Dim f As New Form2
f.StartPosition = FormStartPosition.Manual
f.Location = Me.Location
f.Show()
Me.Hide()
Thanks.
|
|
|
|
|
the command 'Application.Exit()' will completly close the program
- Kyle
|
|
|
|
|
Ummm...Me.Hide() doesn't close the form, it just makes it invisible. You're app is apparently still running because you never closed all your forms, active, invisible, or otherwise.
In order to shutdown your app, you must close your startup form. This form starts the message pump for you application. Since your app is still running, this means that the app's message pump is still running. If the message pump is still running, you never closed your startup form.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
to completly close your program you can use following commands
'(To close all form and exit but not other threads)
Application.Exit
OR
'(To close all forms and threads)
Application.ExitThread()
!alien!
|
|
|
|
|
I know that. I'm just explaining WHY his app didn't close.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for your help and the explination.
|
|
|
|
|
I want to create a virtual serial port from my program, so I can send out serial data. I want my program to simulate an actual physical device, such as a GPS or Gyro, for testing purposes. I have seen many comercial programs that create two virual ports, and connect them, but I want just my program to expose itself as a serial port.
Ross King
------------------------
"Beer. Not just for breakfast anymore"
|
|
|
|
|
Ross, I just Googled "virtual serial port vb" and there were quite a few hits - some of which point to free controls for this purpose. Maybe one of those will do the job for you.
...Steve
"Give a man a fish and you've fed him for a day. Teach him how to fish and you've fed him for life." (Translation: I'll show you the way, but not write the code for you.) I read that somewhere once
|
|
|
|
|
Thanks Steve,
...but I spend yesterday afternoon doing a full google search, using every combination of terms I could think of. None of the controls that come up in google are actually free, and I want more control than those commerical ones allow. Most of the controls you find do a background creation of two virtual ports, so you can write to one, but I want to plug in somewhere in the middle.
Ross King
-----------------------------
"Beer, not just for breakfast anymore"
|
|
|
|
|
|
|
I want to use an image as a background for my VB.net form and add textboxes where I can update these to create a report from a log file of data. My problem is that the form will not scroll long enough during design to add the textboxes at the footer of the image. I have set my screen resolution as high as it will go...width is not a problem. Is this possible in Visual Studio to have the form scale during design time?
|
|
|
|
|
Good evening
I have a hashtable with the following parameters in
[Key]: 4 [Value]: Politics
[Key]: 3 [Value]: Documentation
[Key]: 2 [Value]: Movie
[Key]: 1 [Value]: H:
[Key]: 0 [Value]: -2012889922
Part of my code :
Imports System.Collections
Dim HT_TreeView As New Hashtable()
Dim ht_nodeFound As Boolean
dim NewDirNode as string
NewDirNode = Left(MediaPathAndName(i), PosBackSlash - 1)
ht_nodeFound = HT_TreeView.ContainsValue(NewDirNode)
ContainsValue returns always FALSE even when I'm trying
ht_nodeFound = HT_TreeView.ContainsValue("Documentation")
What could cause my problem ?
|
|
|
|
|
The Contains method looks for a key, not a value. You have to use the ContainsValue if you want to look for values.
If you want to take advantage of the speed of the hashing, you should use the value as key also, so that you can use the Contains method. The ContainsValue method can't use the hash codes, it simply loops through the items to look for the value.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks for your answer. But if you check my code there is written
ht_nodeFound = HT_TreeView.ContainsValue(NewDirNode)
Is this OK ?
|
|
|
|
|
Yes, that's correct. My mistake. I guess that I was more busy finding an error than examining your code.
---
b { font-weight: normal; }
|
|
|
|
|
How do you know NewDirNode equals "Documentation" or if the hashtable actually contains that value?
Try this:
foreach (key as object in myHashtable.Keys)<br />
Console.Out.writeline(string.Format("[{0}];[{1}];[{2}]", key.ToString(), myHashtable[key].ToString(), myHashtable[key].GetType().Name));<br />
next<br />
<br />
NewDirNode = Left(MediaPathAndName(i), PosBackSlash - 1)<br />
Console.Out.Writelin(string.Format("[{0}]", NewDirNode))<br />
ht_nodeFound = HT_TreeView.ContainsValue(NewDirNode)
See what you get.
- Malhar
|
|
|
|
|
I established the Quickwatsh for "NewDirNode", so I know that it contains "Documentation"
with your code I got the same result.
Console.Out.Writelin(string.Format("[{0}]", NewDirNode))
My code to check the content of the HashTable :
Private Sub WrittelnHashTable()
Dim dirHa As DictionaryEntry
Dim Key As Integer = 0
For Each dirHa In HT_TreeView
Console.WriteLine(vbTab + "[{0}]:" + vbTab + "{1}" + vbTab + "{2}", Key, dirHa.Key, dirHa.Value)
Key += 1
Next
It tells me that the hashtable contains the string "Documentation".
[0]: 4 TreeNode: Politics
[1]: 3 TreeNode: Documentation
[2]: 2 TreeNode: Movie
[3]: 1 TreeNode: H:
[4]: 0 TreeNode: -2012889922
If I am requesting any key of the hashtable with CONTAINS I always get a TRUE response.
|
|
|
|
|
I have solved the problem.
In my SUB where I add a treenode to the TreeView
I have add the new added treenode (PrevNode) See code below.
PrevNode = PrevNode.Nodes.Add(NewDirNode)
HT_TreeView.Add(HT_KeyCount, PrevNode)
In the code line "ht_nodeFound = HT_TreeView.ContainsValue(NewDirNode)"
the "NewDirNode" is dimensioned as a string. So the string in the collection won't be found because
the String does not match the treenode.
I changed the code to. See below. and it works.
PrevNode = PrevNode.Nodes.Add(NewDirNode)
HT_TreeView.Add(HT_KeyCount, NewDirNode)
Thanks to Guffa and malharone. Good night.
|
|
|
|
|
hI FRNDS!
I WROTE A VISUAL BASIC PROGRAM IN VB 5.0
AND I NEED TO UPGRADE IT TO VB.NET.
CAN ANYONE PLEASE HELP IN FIGURING IT OUT?
I CAN GIVE YOU THE CODE IF SOMEONE'S READY TO HELP ME!
REGARDS
MY EMAIL IS kamal_aluri@hotmail.com
|
|
|
|
|
First, learn some forum etiquette, AND STOP SHOUTING.
Second, the Upgrade Wizard in VB.NET will not work with VB5 projects, only VB6. You'll have to scrap the code and rewrite it from scratch. Something I would recommending doing anyway, even with a VB6 project.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|