Search results for query: *

  1. P

    Infinity / Divide by Zero

    When VB changed to .Net is when MS removed the Divison By Zero error and incorporated the more accurate ways of handling such computations. Only integer division (a\b instead of a/b) has maintained this error. Otherwise, if the equation is 0/0, that results in NAN (Not a Number), and X/0 results...
  2. P

    errors after turning on option strict

    I'm a little confused with the formula where you are having the error... In your comment above that line of code, you say: "'Valve Coefficient formula = cfm / ((valve diameter * 3.14 * lift)*146) * number of valves" yet the line of code has you dividing instead of multiplying by the "number of...
  3. P

    Optimize Code

    I noticed that you keep having conditional statements which never change after the first... Essentially inside of your While loop, you want to check to see if a file exists and then do all of the other operations with that file; if the file doesn't exist, then you just want to increment your...
  4. P

    Two buttons one subroutine

    If you do have specific code that you want to happen depending on which button was pressed, you can determine which button by the sender variable: Private Sub button_Click(sender As System.Object, e As System.EventArgs) Handles btnTest.Click, btnTest2.Click MsgBox("You pressed " &...
  5. P

    Question Accessing Multiple Items in a Listbox

    You might be able to just create a new int inside of the loop and set that to i (eg "Dim intTemp as Integer = i"), and then use that variable inside the LINQ...
  6. P

    Small math question: lowest useful precision...

    One last thing... If this is for you (or anyone in the US), that'll work fine. However other countries (esp. in Europe) use a comma to separate whole numbers from their fractional part.
  7. P

    Question Obtaining Characters from a sting with the specified character positions in .ini

    First, do you need to use an .ini file or were you just looking for some external text-file that can be easily edited before running the program? If the latter, then I'd just use the VB.Net Settings for your program (eg ProgramName.exe.config file)... VB.Net already has easy ways of reading...
  8. P

    Small math question: lowest useful precision...

    I'd actually be careful with this solution... For example, if a person wants to show the lowest precision in a number and the value of that lowest precision part of the number happens to be 0, they will write that decimal with a zero in the last position to show where the lowest precision occurs...
  9. P

    Filter Sub-directories

    So if you were to replace the part of the code in the first snippet that adds the files to the datatable with everything in the 2nd snippet, you'd get: PublicClass Form1 Dim bs As New BindingSource Public Sub New() InitializeComponent() End Sub Protected Overrides Sub OnLoad(ByVal e...
  10. P

    Question change on the button?

    I believe that you are having an issue with scoping... First of all, you have a variable with the same name as the name of a class (albeit the class is in a different namespace): Dim meni As New Okno1.Meni When you do this, it makes it more difficult to sort out the different scope of objects...
  11. P

    Display a messagebox without a default button

    I finally solved this issue... I think I was going about this the wrong way; instead of trying to get the program to ignore the appended carriage return, I turned it around and did the processing of the scan after I got that carriage return. What was happening was that in my TextChanged event...
  12. P

    Question Trying to find the right code for the score to add +1 each time correct answer given

    Also it looks like you have 2 variables called Score; one is a global variable initiated in the module and the second is as a private variable / property of the class. It looks like you have several forms, one for each question, and if you've set up all of those the same way, then each has its...
  13. P

    Display a messagebox without a default button

    This is actually one of the easiest solutions that I could think of for the actual issue that I'm having... I am trying to write a program where the user scans in a barcode on a device, and the program checks the validity of the scanned value, saves the scan in a database, and then prints out a...
  14. P

    Error when trying to read HTML page

    Argh! I feel like a moron right now... I had been working on a different project to disable browsing on computers out on the manufacturing floor, and had set my proxy to 127.0.0.1 in Internet Options. Although this blocks IE, it doesn't block Firefox, the latter being my main browser. Apparently...
  15. P

    Error when trying to read HTML page

    I'm still getting the same error... I looked at my firewall and it didn't say that it blocked it, but could there be an issue with security somewhere? Or with the way our network is setup?
  16. P

    Error when trying to read HTML page

    I am trying to parse a web-page by having my vb.net program grab the HTML from off the internet. I have a simple function that I want to develop; GetHTML(strURL as String) as String. Basically given a URL address, return the page source as a string. I have tried a variety of ways to do this, but...
  17. P

    Answered Prob. updating DataGridView with DataTable

    This seems like a simple answer. I'm afraid that this question shows my lack of understanding about the DGV in general. Basically, I have a form with a DGV on it that I want to use like a shopping cart... To do this, in the code I'm making a simple DataTable (_adoShoppingCart) with 3 columns...
  18. P

    Lassoing entire controls to select

    Boy does this sound like a Newbie question! I guess it was just irritating to me today, so I decided to finally find an answer to it. Basically, in VBA / Form Design for Access (I can't remember if it's also true in VB6), there was a way to toggle the "Selection Behavior" when "lassoing"...
Back
Top