Answer Questions
Trabi accessing a project level variable accessible via any form or module..
I want to retain the name of a file loaded in a Windows Main Form and then be able to access that same file project name within a user control which is part of the same project as the Main Form. As it is now, I am instantiating a file containing global vars and then instantiating the same file all over again.... with uninitialized vars. Can I instantiate a class above the scope of both Mainform and the User Control which is instantiated before MainForm is loaded, available to both MainForm and User Control, that will persist throughout the runtime instance of the executable If I create a class to be used for global vars, where do I instantiated it Is there a place at the application level I can do this Thank you. -Greg Right now I decl ...Show All
Ted. Standard Deviation
Try as I might i cannot figure out how to code the Mean & Standard Deviation HELP!! OK. Is this homework, or for a real world application Where are you getting stuck You should post the code you have so far and explain where you're confused. Well, if your data is in a container like a list, then you can use for-each to step over it, and the Math namespace for any mathematical operations you may need to perform beyond adding, etc. Do you know the maths behind the operations you're trying to perform I think cgraus was on the right track of providing guidance rather than a take away solution. I don't see how you can get anything but Zero with the formula provided for th ...Show All
Zapp String without terminator "
Hi there, I was using an array of chars to take chars from a serial port buffer. But, when I do a cast to a string, for some strange reason, my string becomes something like string="haskjdh Without the last " !! I think this is really strange, did it happen to any of you P.S. Now I use the ReadExisting method that returns a string directly, but I really curious about the reason for this strange error :-) Thx Code: Dim buf(100) As Char If (Me.SerialPort1.BytesToRead > 0 And Me.SerialPort1.BytesToRead > 100) Then Me.SerialPort1.Read(buf, 0, 100) ElseIf (Me.SerialPort1.BytesToRead > 0) Then Me.SerialPort1.Read(buf, 0, Me.SerialPort1.BytesToRead) End If dim st as string=buf ...Show All
John Jacob Need Help Simplifying
I want to port a VB6 app to VB2005 while simplifying as much as possible. The current program uses multiple random access files to store data, both for user options and individual companies that are independent projects. My question is about converting multiple complex user-defined types into structures and then saving them in two files-- user options and company-specific. This is what I intend doing but would appreciate suggestions on a better way. 1. Create structures for the types, combining as many as make sense into single structures. The user options will be one structure. These structures must be available throughout the entire application. 2. Create a collection of company-specific structures. There is one collection for each ...Show All
barkingdog Looping
How do I setup a for next loop array to open files if I don`t know how many files are in the folder I don`t want to get the file names ,I want to open them You could get an out of memory exception if the file you're trying to load is not a valid image file. Please check what kind of file you're loading before setting picturebox's Image property. Also, setting the pattern to limit the search to a certain extension could help: Dim folder As String = "d:\MyImageFiles" Dim pattern As String = "*.jpg" ... Andrej If you're working with VS2003, try the following: Dim folder As String = "c:\" Dim pattern As S ...Show All
rusty123 disabling some keyboard key
Hello, I created a VB8-Access program, im using ADODB as my connection. now i want to disable the " quote and ' single quote this is my vb6 code Dim keyascii As Short = Asc(e.KeyChar) If keyascii = 34 Or keyascii = 39 Then If keyascii <> 13 And keyascii <> 8 Then keyascii = 0 End If End If and my vb8 code, im missing some part (or maybe my codes are really wrong) If e.KeyCode = Keys.OemQuotes Or e.KeyCode = Keys.______ Then If e.KeyCode <> Keys.Enter And e.KeyCode <> Keys.Escape Then _________ = Keys.OemClear End If End If the first blank is i can't find the single quote then the second one, if i use the textbox unto it, it also didnt work t ...Show All
Shadoware Technologies Good Systems and Analysis Design
Wher can I get some free help on Systems analysis and design for VB.net applications. It doesn't have to be free. I still would like to know about it . If at first you don't succeed, RTFM. That's my $ .02 worth. (since a dollar saved is $.37 earned, my opinion is basically free) On a more serious note, MSDN does have a new Architectural Journal that's available for free at http://www.architecturejournal.net/ Jim Wooley http://devauthority.com/blogs/jwooley Love to keep religion off the Forums!!! "If at first you don't succeed, RTFM. " Priceless except the trademark isn't yours. That's at least 35 years old. Good and free rarely meet, try your local community library. ...Show All
DDressel Iterating through a panel's control collection
Greetings: I've got a panel (pnlExpenses) with several labels and textboxes on it. I want the program to go through the dollar amounts entered in the textboxes and put the subtotal in a class level variable (dcSumOfExpenses). However, when the debugger passes through this Sub, objControl always shows a value of Nothing, and the Count of pnlExpenses.Controls always shows a zero. What is my code missing The panel was added to a tabpage at design time, and the labels and textboxes were laid on top of the panel. Do I need to do something more to establish the panel's controls as a collection Private Sub SumExpenses() dcSumOfExpenses = 0 Dim objControl As Control For Each objControl In pnlExpenses.Controls ...Show All
Jordan Y 2 Questions: Drag and Drop File Path AND SQL Server Update Database
1)What code would I use to get the file path of a file that is dragged and dropped into a form 2) I have a certain table represented in an application as a listbox. On the form opening, the listbox is filled with the contents of the table. How can I have it that the table is saved with the listbox items at the form closing (what code , i'll place it on Form_Closing) Yes. You may also want to modify the Drag_Enter event handler to check the data (similar to the code in Drag_Drop), and not set the effect value if the length of the array is not 1. That way you will only see a drag_drop event if they drop 1 file, and if they try to drag multiple files they will get a visual indication that they can't do this. -Scott ...Show All
Mathew1972 Use the Application Object
I am creating a new VS2005 VB.NET Windows Application. The application is intended to exchange inforamtion between two Microsoft Project (*.mpp) files. I am having just a little trouble getting started. I need to add a reference to the Project objects, I can do that by adding a reference easily enough. What I am looking for is just an example of how to create an instance of a Microsoft Project Object (.mpp), assign that object to an existing mpp file and then access the member functions, etc. to edit the tasks in Project1.mpp. For example, suppose my GUI has a textbox1.text=c:\a\Project1.mpp and I have another textbox2.text="LATE" ... so, when I press my "Process button" I want to have my application set the T ...Show All
Fox Me Up Assist with class design
Hi, I am creating my classes based on entities form database. I am kind of confused on one scenario though. If I have a Product Class and Location Class which both have in common a LocationID property, is tis possible. It's possible in my requirement but I am not sure how to work this in my classes. Can I then do this Public Class Product Public Property Location() as Location Get Return New Location() End Get End Class How can I access the locationID from Location Property() and How can I set the location ID Thanks What is the relationship between Product and Location It seems like you have something like this. If you can give more details as to how Location, P ...Show All
Daxez n00b - Compiling Code
Hi there, I am a newbie to VB.NET. And have just started learning from a book. I've gotten part way through the book, when I realised that I can no longer run code that I have saved and closed out of. I can't even get back into the designer. Also, how do I compile code that I have written so that it can be run on someone else's computer without having to have VB.NET Express Edition installed and only the VB.NET runtime All help much appreciated. What have you done to "close out" source Just closed the source window It will be run, nevertheless. To open it, choose View->Solution Explorer and open up the designer or source as you need it. Make sure to build the Release Version (see the ...Show All
Mannequin666 Visual Basic & SQL Server
Hi guys, I am doing this for the first time, writing code for SQL Server from Visual Basic. Please I will like to know how to do the following i. Binding data from SQL server to VB forms ii. Making Changes to the form and determining when the form has changes. iii. Saving a new record on the form to the database table iv. editing/deleting a record v. Navigating to next, previous, first & last record. ----------- Note, I have already created a database with the table(s) ands views. I can connect to the database from my application. Please I will appreciate if I can be directed to forum/URL/on-line books that deals with data manipulation; using VB and SQL. I would highly suggest running a search ...Show All
polymorphicx Accessing registry using VB2005
Hi, I want to search for the installed software via registry. I don't know what should be exact path where i can locate the installed software in registry or what will be the keys which will help me to search all the installed software on the specific system. Please help me out. thanks. That really helped but made me confuse as well. I want to extract Software Name Software Manufacturer and both "userdata" and "uninstall" don't have a specific pattern from where i can extract it. instead HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\AppPath gives good info. What you suggest My requirment is to get SoftwareName, SoftwareManufacturer as well. Sorry, I thought you men ...Show All
brianmultilanguage DataTable or DataSet
I'm trying to create an SQL statement that will return duplicate fields from a Text file that I imported. The imported file is NOT in a Database, but rather in memory. What should I query against, the DataSet or the DataTable Also, how do you create a complex SQL statement and use it against the DataSet/DataTable Looking for something like this: SELECT * FROM myTable WHERE ssn IN(SELECT ssn FROM mytable GROUP BY ssn HAVING COUNT(*) > 1; Any sugguestions would be great!!! EZ1976, DataTable is a table that created in DataSet. In order to use DataTable, it means that you are creating a table in memory of DataSet. In order to return the duplicate fields from the text file, I suggest you to divide the SQL query statement int ...Show All
