Search:

Type: Posts; User: squared

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    18,009

    Adobe-style Control Set

    Here are some Adobe-style controls I created. Feel free to suggest new ones. This is a work in progress.

    Unfortunately, I don't have the correct font right now. It will be packaged with the next...
  2. Replies
    7
    Views
    8,406

    Re: add two 6 sided dice rolls

    Cleaner and type-safe code would be this:

    Dim r As New Random()
    Dim r1 As Integer = r.Next(1, 7)
    Dim r2 As Integer = r.Next(1, 7)
    Me.Label1.Text = r1.ToString()
    Me.Label2.Text = r2.ToString()...
  3. Replies
    0
    Views
    4,497

    9-slice scaling

    Here is a bit of code to use for 9-slice scaling. For now, all corners must have the same dimensions, but I hope to change that later on.



    Module Extensions
    ...
  4. Replies
    12
    Views
    3,152

    VS 2008 Re: Checking if process exists

    Is this resolved now?
  5. Replies
    13
    Views
    1,707

    Re: Find Screen Pixel Of Choosen Color

    Using the SendKeys class is a bad way to do anything. Instead, you may use Graphics.CopyFromScreen to do the same thing, and Bitmap.LockBits to increase performance:


    Private Function...
  6. Replies
    13
    Views
    2,285

    VS 2010 Re: Show NUD with Inches mark

    The start you have could lead to some confusion, as this:

    Me.InchesNumericUpDown1.Text = Me.InchesNumericUpDown1.Text
    Would actually change the value. I believe you are better off handling the...
  7. Replies
    10
    Views
    1,282

    VS 2008 Re: How can I improve this?

    Reference types default to Nothing, and value types to 0 (numeric) or Empty (structure types with all the fields at the default value). So there is no need for an = Nothing, = xxx.Empty, or = 0...
  8. Replies
    10
    Views
    1,282

    VS 2008 Re: How can I improve this?

    I would also suggest removing the = Nothing initializers, using bytes(1023) instead of bytes(1024) (in VB.NET, you define the upper boundary and not the length), using IO.File.WriteAllText instead of...
  9. Replies
    2
    Views
    682

    VS 2010 Re: ListView Box

    Me.(Name of Button).Enabled = (Me.(Name of Listview).Items.Count > 0)

    Put this in a Sub and call it whenever you change the ListView.
  10. Re: Using the Split Method to extract the itemcost and then add it to a running total

    There is a convenient second parameter to the method that will remove the $ sign for you and also is more globalization-friendly:

    Decimal.Parse(item.ToString(),...
  11. Replies
    4
    Views
    1,022

    VS 2010 Re: Unsigned 128 Bit Number

    So what is the problem now?
  12. Replies
    41
    Views
    2,699

    VS 2008 Re: A quick fix?

    That seems incredibly lazy of you, and I don't blame you for wanting to avoid it.
  13. Replies
    41
    Views
    2,699

    VS 2008 Re: A quick fix?

    Firstly, as far as I know, without "manually" recursing through the files (as opposed to using SearchAllSubdirectories) you cannot have any sort of progress indicator or thread pool threading. So you...
  14. Thread: Auto redraw

    by squared
    Replies
    2
    Views
    928

    Re: Auto redraw

    May we see the code you are using to draw the graphics? With any lag at all on a computer like that, you are doing something wrong.
  15. Replies
    41
    Views
    2,699

    VS 2008 Re: A quick fix?

    Here is a simple "frame" for what you want (assumes Imports System.IO and System.Threading):

    Private Sub SearchFolder(ByVal folder As Object)
    Dim di As DirectoryInfo = DirectCast(folder,...
  16. Re: User Input Arrays to show in List Box on seperate Form

    @Zach_VB6, unlike C#, in VB.NET when you define an array you are defining the upper boundary, not the length, of the array. So the code is fine as is.
  17. Replies
    5
    Views
    886

    VS 2010 Re: Pressing button 1 of another program

    Alternatively, you can use FindWindow and Form.FromHandle and click the button using .Controls("button name").PerformClick() as usual.
  18. Thread: SHA1 Hash

    by squared
    Replies
    4
    Views
    2,043

    Re: SHA1 Hash

    Personally, I would use:

    Dim p As New Security.Cryptography.SHA1Managed()
    Dim r() As Byte = p.ComputeHash(System.Text.Encoding.Unicode.GetBytes("String to hash"))
    Return (From x As Byte In r...
  19. Replies
    3
    Views
    4,294

    Re: Rounded Corners

    Option Strict-compliant, safer, and more customizable version:

    Private Sub MakeRound(ByVal c As Control, Optional ByVal radius As Integer = 20)
    Dim p As New Drawing2D.GraphicsPath()
    ...
  20. Replies
    2
    Views
    992

    VS 2008 Re: owner drawn datetimepicker

    I'm sorry, but could you please state your question a bit more clearly? What exactly do you mean this custom control to do?
  21. Replies
    2
    Views
    639

    VS 2008 Re: Run app from website

    I don't quite understand your question - do you mean that you want to run the files as they are being downloaded? I will assume that your question is not to run the files without downloading them...
  22. Replies
    4
    Views
    1,840

    VS 2010 Re: HttpWebRequest Help

    Create an HttpWebRequest and request the directory. If an exception is thrown, it does not exist.

    Try
    Dim w_rq As WebRequest = WebRequest.Create("http://forum.com/directory")
    ...
  23. Replies
    5
    Views
    800

    VS 2008 Re: Saving web page?

    I would have thought that was obvious:

    Using saveDialog As New SaveFileDialog()
    If saveDialog.ShowDialog() = DialogResult.OK Then
    Using wc As New Net.WebClient()
    ...
  24. Replies
    5
    Views
    800

    VS 2008 Re: Saving web page?

    It is exceedingly simple:


    Using wc As New Net.WebClient()
    wc.DownloadFile("http://example.com/page.html", "C:\savefile.html")
    End Using
  25. Replies
    12
    Views
    1,373

    VS 2008 Re: Anti-file duplication

    Here it is, though I didn't implement merge. Maybe I will in a future project, this is a good idea.

    On my computer, it took about 7 minutes to identify duplicates in my personal folder...
  26. Replies
    12
    Views
    1,373

    VS 2008 Re: Anti-file duplication

    I'm currently writing an example program for you, but it's proving to be quite a large task, compared to what I originally thought.
  27. Replies
    12
    Views
    1,373

    VS 2008 Re: Anti-file duplication

    MD5 checksums would be very reliable in this case. Create an index of the files on the hard drive along with their MD5 hash values, then compare each item to all the other items to see if they are...
  28. Replies
    6
    Views
    3,137

    VS 2008 Re: sort Multi-dimensional Arrays

    Use List(Of t) instead of ArrayList, BTW.
  29. Replies
    18
    Views
    1,859

    VS 2008 Re: Access is denied

    No. Even on Windows XP, you could not access some modules. In your For loop, instead of this:

    If target.Modules(d).FileName.Contains("mydll") Then
    ModHandle =...
  30. Replies
    4
    Views
    829

    VS 2010 Re: Performance questions for animated GIF.

    You should give it a try, first - I have created many tower defence games that redraw the whole screen, and with DoubleBuffered=True, there is no noticeable performance difference.
  31. Replies
    2
    Views
    1,013

    VS 2008 Re: OpenFileDialog - Restrict to Initial?

    I believe that the easiest way to solve this is to just create a custom dialog. There are many Explorer-style-control examples in various programming forums, including this one.
  32. Replies
    4
    Views
    829

    VS 2010 Re: Performance questions for animated GIF.

    I suggest using GIFExplode (http://www.gifexplode.com/) to convert your GIF into a series of images, and then use the Graphics object to display the frames, staggered for each instance of the image....
  33. Replies
    7
    Views
    921

    Re: Looking for a Project Idea

    Write a Javascript interpreter in an object-oriented way. That should be quite a challenge.

    Personally, I'm writing a syntax highlighter + IntelliSense + cross-browser-verification editor for...
  34. VS 2010 Re: count childnodes of parent (Treeview)

    Let me clarify. You are looking for a way to count a node's child nodes, correct? What information do you have? Do you have the node whose children you want to count? A child of that node? The name...
  35. VS 2010 Re: count childnodes of parent (Treeview)

    So, what information do you have? The child of the parent?

    (childnode).Parent.Nodes.Count
  36. Replies
    11
    Views
    1,270

    Re: Array functions?

    I believe what you want is this (although I'm not quite sure - your question is not very clear):

    var toExtend = [/* array of strings of the functions to extend */];
    for(var i = 0; i <...
  37. Replies
    11
    Views
    1,332

    VS 2010 Re: File Search not working

    @sapator: Just because a directory's name ends in "simon" doesn't mean it's the directory he is looking for - a more accurate check would be If d.ToLower() = "simon". However, I believed the variable...
  38. Replies
    11
    Views
    1,332

    VS 2010 Re: File Search not working

    Did you want to search recursively? If so:

    Dim s As New Stack(Of IO.DirectoryInfo)
    s.Push(New IO.DirectoryInfo(sDir))
    While s.Count > 0
    Dim pdi As IO.DirectoryInfo = s.Pop()
    For Each...
  39. Thread: Please help me

    by squared
    Replies
    1
    Views
    746

    VS 2010 Re: Please help me

    Using wc As New Net.WebClient()
    wc.DownloadFile("http://theegyptianlegend.co.cc/iPhodroid/downloadi", "C:\tempFile.zip")
    End Using
    Then http://www.vbforums.com/showthread.php?t=360169
  40. VS 2010 [RESOLVED] Is there a problem with using SyncLock and Monitor together?

    I was just wondering if mixing SyncLock blocks and Monitor.Enter/Exit statements is dangerous. I know SyncLock uses Monitor and a Try block in the background, but are there any problems with using...
Results 1 to 40 of 70
Page 1 of 2 1 2



Click Here to Expand Forum to Full Width