|
jacob.vankley wrote: I need to know how to declare "global" variables
jacob.vankley wrote: I have two forms, and I need to have the variables from one accessible to the other.
That is no reason to use global variables.
jacob.vankley wrote: Please don't tell me that this should be sending off red lights
Well... It seems you already know it is a bad idea.
Perhaps your question should have been: I need to share information between two forms. Is there any way to do this without using global variables? If so, how?
To which my answer would have been: Read this article[^] about passing variables between forms. It was written for VB.NET 1.1 but it should still be valid for 2.0
|
|
|
|
|
Thanks so much! I will try that, and it should work.
|
|
|
|
|
I've been trying to figure out how to connect to the DHCP database on a 2003 DHCP server. It's a jet database, but I can't find a way to access it.
What I want to do is pull scope range and options from my 2 DHCP servers and then compare them to make sure everything is redudant. I also want to set up email alerts for any scope that's >90% utilization.
But first I have to connect to the database. I've been playing with the netsh command which gets me some information, but it's not very legible. I'd rather pull just what I need and leave everything else out.
Any help would be greatly appreciated.
Thanks.
JnyBot
|
|
|
|
|
I don't have a 2003, or any other version, DHCP server running anywhere, but I would imagine that that database is locked exclusive while the DHCP server is running. It's entirely possible that just getting a connection to it would be impossible without stopping the DHCP server.
You can find out just by trying a connection to the database file which, I THINK, is in C:\Windows\System32\dhcp\dhcp.mdb, or somewhere south of there. If the OleDbConnection fails to open, try stopping the DHCP service and try it again. If it works, you have your answer.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I am writing a front-end for a car PC project. I have managed to code an FM Tuner and an MP3 player by using windows messages and Winamp. My next part of the project is a DVD player. At first I thought that this would be quite easy, use WMP. So I tried and got a few of the functions working, but it keeps crashing and rebooting the computer at random times. I have read a lot about using it and everyone says that DirectX is the way to go, (well DirectShow anyway). Please could someone give me a sample piece of code for VB.net as I have searched for hours and can't find anything.
Thanks in advance for any replys
|
|
|
|
|
If you have the DVD codec installed on your PC, then WMP will do this for you just fine. If you don't, then nothing will work.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
That's the strange thing. If I use WMP from the Windows Start menu it plays DVD's fine. But when I put WMP into a form in visual basic, it starts to play it, but then pauses, jumps about and crashes!
|
|
|
|
|
That's odd. It's not how your code is calling WMP ?
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Dear Listers,
My involvement in programming only xtends to TSQL. I'm looking to take-on VB.Net. What would you recommend are suitable texts for entry-level into this code?
TIA
John
|
|
|
|
|
|
Using the code below, I can only do an EXACT seearch for an item in a listview control; however, I'd also like to do a PARTIAL search as well but can't get that working from what I can find. I know there is a FindNearestItems method, but no luck in getting that to work.
Any suggestions on how to code the partial search?
Here is my code that works well in a doing an EXACT search:
Private Sub txtSearch_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSearch.TextChanged
Dim Itm As ListViewItem = lstItems.FindItemWithText(txtSearch.Text, True, 0, False)
If Not (Itm Is Nothing) Then
lstItems.Items(Itm.Index).Selected = True
lstItems.EnsureVisible(Itm.Index)
lstItems.Focus()
End If
End Sub
|
|
|
|
|
I didn't know this was on offer at all. I reckon you'll need to iterate over the items yourself.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I am trying to move a label from form1 to form2 and I don't want to have to create another label on form2 and transfer all the information it carries to the other form and then back again. So what I want to do is just move the label from form1 to form2 and then later back again. If anyone can help it would be greatly appreciated. Thank You!
|
|
|
|
|
That's not a real good idea. You'd be much better off and have far more maintainable code if you just created the label on the second form and changed the text property when you needed to. What you're proposing is overly complex for little benefit.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
This is so wrong. You shouldn't be moving controls between forms, the controls shoudn't even be visible between forms. What a disaster.
To communicate between forms ( passing text to set labels, for example ), form2 can expose a property that form1 sets ( a string that sets the label ), form2 can take the string in it's constructor, or you can set up delegates to pass the info between forms based on some event in one form.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I need to know how to add files to the Application Files List in publish section of a project in VB 2005 Express Edition, specifically a database file. The file is in the resource section but i need it to show up in the application files list
|
|
|
|
|
Add existing file to project ? Why does it matter what list it's in ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
i dont need to add it to the resource file i need to add it to the Application file list so that i can deem it a data file and the program will place the file in the correct place to be accessed by the program otherwise when i install the program it looks for the database and cannot find it, then errors out and shuts down the program. Unless anyone knows a different way to tell the installer to copy that database file to the correct path?
|
|
|
|
|
I want to make a game using vb.net.
I am a beginner and not very good at developing codes for an object to move.
please help.
simalike
phunz
|
|
|
|
|
wrote: please help.
You haven't really specified what it is that you need help with. To "move objects" could be anything from animating cards in a solitarire game to simulating three dimensional real time physics.
---
Year happy = new Year(2007);
|
|
|
|
|
Sounds to me like you're one of the many people who try to write games before first learning enough core concepts to stand a chance of completing a game project. There are books on how to write games, I suggest buying one, but also working on knowing the core of your language better before adding DirectX to the mix.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Beginners often seem to want to run before they can walk!
Kevin
|
|
|
|
|
Yeah, when I read graphics forums, they were full of 'I just found out about C++, who wants to join my team to make a killer 3D engine, it will be better than all the others, and do xxx and yyy and zzz, even though those things are not possible with current technologies'.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
I want to make a game using vb.net.
I am a beginner and not very good at developing codes for an object to move.
please help.
phunz
|
|
|
|
|
Hi.
I have a web application, which runs on the server. The application supposed to access folder on the Intranet (provided by user), grab some files and read them. The problem I have is the security. Some folders on the Intranet are not accessible. What happens is when user provides directory address to my application I cannot access the folder due to access denied error. How can I go around that? In my web.config file I have set but still it doesn't work.
Thank you,
|
|
|
|