Search Results - VBForums

Search:

Type: Posts; User: Inferrd

Page 1 of 13 1 2 3 4

Search: Search took 0.03 seconds.

  1. Replies
    6
    Views
    445

    VS 2013 Re: Order files by name (ListBox)

    I assume you want it to appear as it does in the Windows Explorer window.
    You can implement a "natural sort order" with a bit of pinvoking:
    Imports System.IO

    Public Class arved

    Private...
  2. Re: Anybody ever had trouble with the GZipStream class ?

    :thumb:

    If you're using VB2010 or later, you may want to consider using the Stream.CopyTo Method that was introduced in .NET FW 4.0. It makes for prettier :p code:
    Public Function...
  3. Re: Anybody ever had trouble with the GZipStream class ?

    Are you using .NET's GZipStream? Your code is using ZlibStream.

    Anyway,the MSDN docs for the GZipStream.Write Method says
    The write might not occur immediately but is buffered until the buffer...
  4. VS 2008 Re: Why won't Convert.ToByte convert 128?

    That's because the overload of the Convert.ToByte method you are using there is the one that takes a 32 bit Integer as an argument (not a Char), and 128 as an Integer will happily fit into an...
  5. VS 2008 Re: Why won't Convert.ToByte convert 128?

    The Chr method works with the ANSI Code Page that is in effect for the current thread that you code is running on. In the Western hemisphere, it is most often Windows-1252. Windows-1252 places the...
  6. Replies
    4
    Views
    166

    VS 2013 Re: Line height RichTextBox

    For example, if you have a RichTextBox named RTB that contains rich text, add the following MouseUp event handler, and select a character on a line:
    Private Sub RTB_MouseUp(sender As Object, e As...
  7. Replies
    4
    Views
    166

    VS 2013 Re: Line height RichTextBox

    Not tested, but:

    Get your known character's position in the RTB (.GetPositionFromCharIndex method)
    Get the line number that your character is on (.GetLineFromCharIndex method)
    Add 1 to give the...
  8. Replies
    26
    Views
    526

    Re: How do I create unique random numbers?

    That was my understanding of it also. However, my thinking was that if you set a new seed position, then the resulting new sequence of random numbers would be different to the sequence that was going...
  9. Replies
    26
    Views
    526

    Re: How do I create unique random numbers?

    What harm does repeatedly calling VB's Randomize function actually do? Yes, it's inefficient, but you could argue that it results in a more randomised sequence.

    On the other hand, repeatedly...
  10. Replies
    3
    Views
    208

    VS 2013 Re: Listbox.selecteditem buferoverflow ?

    The recursion probably isn't helping :sick:

    Private Sub check()
    cashdo()
    If GetMd5Hash(hash, cash) = TextBox1.Text.ToString Then
    MsgBox("found ! " & cash, 64)
    ...
  11. VS 2012 Re: Object reference not set to an instance of an object.

    I also have a different answer. I agree with the others that the Dim instance As New TheStuff in the btnNew_Click Sub is creating a local variable that is hiding the form level variable from the code...
  12. Re: Assignment due tomorrow and I am extremely confused

    If you don't know what to put, then always consult the documentation. See https://msdn.microsoft.com/en-us/library/system.windows.forms.tooltip.settooltip%28v=vs.100%29.aspx
    You need to pass the...
  13. Re: Assignment due tomorrow and I am extremely confused

    The sender parameter of a Control's Event Handler Sub holds a reference to the Control that raised the event.

    Assuming you are handling the CheckedChanged Event so that you can update your array...
  14. Re: Assignment due tomorrow and I am extremely confused

    Yep, lots of different ways of coding any given problem. Here's my take on it, based on what you have said previously.


    Think of your 2D array as representing a table of information. Each row in...
  15. Replies
    8
    Views
    353

    Re: what about this 4 line of code

    Are you changing the collection, though? A file is deleted from the hard drive, but I'd not expect that to cause its entry to be removed from the array of FileInfos. The collection isn't linked to...
  16. Replies
    15
    Views
    404

    Re: Memory allocation: Byte Vs Boolean

    What is it you are trying to do?

    Are you creating a large array of Booleans and trying to save memory by using a Type that has smaller memory consumption?

    If so, I wouldn't bother using a Byte...
  17. Replies
    11
    Views
    310

    Re: Help With Key Press Commands

    You just Copy and Pasted that into your project? Of course it won't change the state of the buttons, as it includes no code to do so. It was merely meant to illustrate at what point in the code you...
  18. Replies
    11
    Views
    310

    Re: Help With Key Press Commands

    Both of those KeyPress Event handler Subs will be run whenever ANY key is pressed on the keyboard. You only need one handler sub and 2 Select Case blocks as you had in the previous incarnation of...
  19. Replies
    3
    Views
    179

    Re: Remove spaces from string.

    :)



    That one was my first naive attempt and won't deal with multiple blank lines in succession. However, the second regex I posted will.

    Your C# one looks better as it should deal with...
  20. Replies
    3
    Views
    179

    Re: Remove spaces from string.

    Is it just the blank lines you want to remove? If so,
    theNewText = Regex.Replace(theOldText, "\r\n *\r\n", vbNewLine) should do that, assuming the line breaks are CRLF character pairs.

    Edit: On...
  21. Replies
    7
    Views
    249

    VS 2010 Re: Clipboard - Multiple Outlook Attachments

    As far as I'm aware, you'll only ever have the one memorystream to play with.

    Here's a hacky way of fetching the file names:


    Dim fileNames As New List(Of String)

    Dim theStream As...
  22. VS 2012 Re: array.sort and array.binarysearch query

    If all you are doing is taking a hex code and using it to look up the corresponding mnemonic and address mode, then a Dictionary might be a better choice as you don't need to worry about sort order,...
  23. Re: ListView error while adding new item

    When you close Form2, it is disposed of. The next call to Form2.Show spawns another, different default instance of Form2, with an empty ListView. You add a single Item to it, but then try to add a...
  24. Re: * How to choose the top 5 from a textfile of items that have been bought and save

    If I were doing this for real, I'd probably iterate through each line in the text file and populate a Dictionary(Of String, Integer), where the String would be the name of the item, and the Integer...
  25. Re: * How to choose the top 5 from a textfile of items that have been bought and save

    LINQ freaks me out. It's as if it has a life of its own and just grows and grows as I code it.

    For example:

    First, create a text file to test with:


    ' example items
    Dim theItems() As...
  26. Re: * How to choose the top 5 from a textfile of items that have been bought and save

    The results from .paul.'s code are available in his top5 array as Strings.

    You would add that array to your ListBox the same way you would add any array of Objects to a ListBox.
  27. Replies
    16
    Views
    365

    VS 2008 Re: Find specific characters

    You don't say whether my code managed to display the error digits or not.

    Seeing what the printer actually sends you might shed some light on the problem. Can you save the raw data to a file and...
  28. Replies
    16
    Views
    365

    VS 2008 Re: Find specific characters

    That code was grabbing the second line from the three lines of the message you posted above. As you are seeing what looks like the first line, then that would suggest that there are actually 4 lines...
  29. Replies
    16
    Views
    365

    VS 2008 Re: Find specific characters

    maybe
    Dim theErrs As String = returndata.Split(New String() {vbCr, vbLf}, StringSplitOptions.RemoveEmptyEntries)(1).Replace("ERRORS: ", "")
    MsgBox(theErrs)


    If the other solutions didn't work,...
  30. VS 2010 Re: Is this a bug? Parameter is not valid when showing a form

    Moreover, isn't the Form's Font object the same Font object that is used by all the Controls which the Form contains? So disposing the Label's Font would effectively dispose the Form's Font and all...
  31. Replies
    17
    Views
    470

    VS 2010 Re: GetElementByID function

    Now it's beginning to get complicated, and there's probably better ways to go about this, but.....

    When you click the Address button, the web page code seems to load a document from...
  32. Replies
    17
    Views
    470

    VS 2010 Re: GetElementByID function

    Firstly, while navigating to that specific page, the browser is loading lots of different documents. You need to check it has completed loading the specified .htm document.

    Secondly, the element...
  33. Thread: Sin-1...

    by Inferrd
    Replies
    3
    Views
    157

    Re: Sin-1...

    Based on Muhammad's previous posts, I'll take a guess that he maybe wants something like this:

    TextBox1.Text = "Sin" & ChrW(&H207B) & ChrW(&HB9)


    Sin⁻

    Unicode has several superscript...
  34. Replies
    4
    Views
    183

    Re: Changing windows date settings

    Just subtracting 8 hours from your system time with, for example, Now.AddHours(-8)) is going to give you the wrong results when daylight savings times collide. Times between 08/March/2015 10:00:00...
  35. Replies
    14
    Views
    220

    Re: A question about defining GDI rectangles

    Don't know.
    Dim rect As Rectangle = Rectangle.Round(original.GetBounds(GraphicsUnit.Pixel)) works for me.

    All I can think of off the top of my head is maybe you have a confilct of namespaces?...
  36. Re: Dual progress bars: Current file, total files

    Does your program actually just hang while trying to fetch the file sizes?

    This line looked a bit dubious to me:
    Return HttpWebRequest.Create(url).GetResponse().Headers.Get("Content-Length") so...
  37. Replies
    14
    Views
    220

    Re: A question about defining GDI rectangles

    It would help if you said why VB "doesn't allow" you to do what you are attempting to do.

    Do you get an error? If so what is it? If not, what does actually happen?


    Dim rect As Rectangle =...
  38. Replies
    9
    Views
    2,266

    Re: Split string into two integers

    Not really sure where you are trying to split your input, or what you would do with the parts afterwards.

    However, if your input is in fact just 5C353B098ABD, then could you not work with Longs...
  39. Replies
    30
    Views
    1,039

    VS 2010 Re: Random Maze Generator

    @passel: my remarks in post #23 weren't aimed at you or anyone else in particular :). They were just my observations on the way the recursive backtracker seemed to be behaving when I was playing with...
  40. Replies
    30
    Views
    1,039

    VS 2010 Re: Random Maze Generator

    If you've created code that implements the recursive backtracker algorithm as outlined in the link given in the first post, and use it to build a maze starting from the entrance (green) cell, then...
Results 1 to 40 of 500
Page 1 of 13 1 2 3 4



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.