|
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
|
|
|
|
|
Upgrade it using VB6 first then upgrade from there to VB.NET.
George Carlin wrote:
"Don't sweat the petty things, and don't pet the sweaty things."
Jörgen Sigvardsson wrote:
If the physicists find a universal theory describing the laws of universe, I'm sure the a**hole constant will be an integral part of that theory.
My Blog[^]
|
|
|
|
|
IMHO, that just has " , happended to this" writen all over it!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello everyone,
I have a Visual Basic 6 project that uses an MS-Access database for storage. I want to be able to backup this working database either on demand or at a certain time each day.
What I have in mind is this. Let the user pick where they want the database stored by using a form that will let them choose the drive and folder for the backup. If they don’t choose a folder or one doesn’t exist. The application will create one for them on the desired drive. If there is no existing .MDB file in the folder the application will use the structure of the working database and create a blank one using the same table and field names from the source database. And will proceed to populate the target database with information stored on the source database.
So I have two separate questions:
1. How do I create a folder on a specific drive using VB code?
2. Using ADO create a new database by reading the table structure of the source database, and save it as a new .MDB database file?
Thank you,
Quecumber256
|
|
|
|
|
You can use the FileSystemObject[^] and its CreateFolder[^] method to create the directory.
If all you're doing is making a backup of the entire database, why not just copy the .MDB file to the backup directory? CopyFile[^] method...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'll try this tomorrow. It looks like it will do the trick. I'll provide the drive distination using the drivelist object.
Thank you,
Quecumber256
|
|
|
|
|
Hello,
I'm looking to create a program using visual studio.net / vb.net that will read a .csv file, and then be able to printout the results from a printer.
Can anyone direct me to some articles that will assist me?
Thank you,
Rashar
-- modified at 11:14 Thursday 2nd February, 2006
|
|
|
|
|
Load teh comma separated values into a datagrid and print it with this?[^]
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|