User Profile

Collapse

Profile Sidebar

Collapse
cugone
cugone
Last Activity: Jul 5 '08, 07:20 PM
Joined: Sep 28 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • cugone
    replied to Call: Is it necessary?
    Using the Call statement is more of a readability preference than anything.

    Be aware though, that it's only safe to use it on Subroutines, not Functions, as when it's used on Functions it causes the returned value to be ignored.
    See more | Go to post

    Leave a comment:


  • cugone
    started a topic Renaming files in use.
    in .NET

    Renaming files in use.

    I write my own update functions/programs for my programs. (Go me. :< )

    Occasionally I need to update the /updater/, but I can't rename a file that's currently in use like the operating system does (Test it out, you can rename a file while it's in use). Is there a way to remove it from the stack without closing it so that's possible?

    I use VB 2005.
    See more | Go to post

  • cugone
    replied to Button Array controls
    You must first cast the sender (an Object type) to a Button type (it is in object form because all classes derive from Object)

    [CODE=vbnet]
    dim testButton as Button = TryCast(sender, Button)
    MessageBox.Show ("You clicked button: " & testButton.name )
    testButton.Back Color = Color.ColorValu e
    [/CODE]
    See more | Go to post
    Last edited by Killer42; Oct 29 '07, 02:35 AM. Reason: Changed CODE tag to CODE=vbnet

    Leave a comment:


  • cugone
    replied to class libary
    Try passing the form by reference (ByRef)
    See more | Go to post

    Leave a comment:


  • cugone
    replied to Numbers in Strings
    Every string object has a method called "Chars()" that allows you to pull out characters at specific locations. In your case, you're using a textbox, so it will be [Object_Name].Text.Chars()

    For example:
    [CODE=vbnet]dim intFirst as Short = Convert.toInt16 (txtNumber.Text .Chars(0))
    dim intSecond as Short = Convert.toInt16 (txtNumber.Text .Chars(2))
    dim intAnswer as Short = intFirst + intSecond
    Me...
    See more | Go to post
    Last edited by Killer42; Oct 29 '07, 01:57 AM.

    Leave a comment:


  • You almost have it. :]

    In your button's click procedure put an if statement like so:

    Code:
            If MessageBox.Show("Do you want to close?", My.Application.Info.Title, _ MessageBoxButtons.YesNo, MessageBoxIcon.Question) <> _ Windows.Forms.DialogResult.Yes Then
                Me.Close()
    Basically, if the user clicks anything but yes (in this case, no) the dialog box just...
    See more | Go to post

    Leave a comment:


  • cugone
    replied to action on mousemove event
    Instead of using a mouseMove event, it would be easier to check if the user is actually using the form. You will already have the code in place for what each control is supposed to do, just reset the timer inside each of those subroutines.

    Better yet, write one function/subroutine that resets anything to do with the timer and re-use it that way. That's one aspect of programming: code reuse. :>
    See more | Go to post

    Leave a comment:


  • cugone
    replied to Reading Text Files
    What version of VB? 6.0, 2003, or 2005?
    See more | Go to post

    Leave a comment:


  • cugone
    replied to VB Project Walkthrough
    I'm a little perplexed at how you have a diploma (BS or MS?) in Computer Science and don't know how to at least do /something/ in that list. It looks like the Manager, User, etc. is just a class data type.
    See more | Go to post

    Leave a comment:


  • Could you pack your code into a zip file and attach it? I've never heard of the problem before and would like to get a more visual representation of what it's doing.
    See more | Go to post

    Leave a comment:


  • cugone
    replied to Initially Empty Labels
    Depending on the legal range of numbers you want, just put a number outside said range and check for not that number. EX:

    Your legal range is zero or above:

    Code:
    'This can also be accomplished by setting each label in the Propeties tab on the
    'Designer page (select them all, set the Text Prop to -1.0).
    
    label1.text = "-1.0"
    label2.text = "-1.0"
    ...
    ...
    See more | Go to post

    Leave a comment:


  • Short answer: No.

    Long answer: VB stores what files you had open, and which one was currently active when you last closed the project. So if you have your code views open they'll be the ones to show up. Frankly, once I get the UI done, I never open the designer windows ever again.

    Confused answer: If you really mean "How do I run a program without using the F5 key?" Then you have two options:
    ...
    See more | Go to post

    Leave a comment:


  • cugone
    replied to loop problems/memory problem
    Set it up as a Windows Service and it will run in the background....
    See more | Go to post

    Leave a comment:


  • cugone
    replied to "Optional" Array Parameters
    You're welcome, though I need to mention I made a little typo in the description. Optional parameters must be listed /after/ all required parameters, not before. And still, can not be used if you use ParamArray and vice versa....
    See more | Go to post

    Leave a comment:


  • cugone
    replied to "Optional" Array Parameters
    Here's what you need:

    Code:
        ''' <summary>
        ''' Compares array values to a given string.
        ''' </summary>
        ''' <param name="array1">Required. Array to compare against.</param>
        ''' <param name="valueX">Required. String value to compare.</param>
        ''' <param name="retry">Required. Whether or not to try the second,
    ...
    See more | Go to post

    Leave a comment:


  • cugone
    replied to Strip string before # (a charc)
    Why yes, yes it was I didn't notice it because he said not to pay attention to that routine. :/ Well, code937, if you ever switch to 2005, that's how you do it....
    See more | Go to post

    Leave a comment:


  • cugone
    replied to loop problems/memory problem
    You could have a timer that checks the database every hour or so for new records instead of having it run constantly. (1 hour is 3,600,000 milliseconds if you need to know. :P )
    See more | Go to post

    Leave a comment:


  • Uh...thanks, but I'd rather not spend $500 to get something I don't need.

    Again, I'm writing the program in VB 2005, not C#. The namespace I want to use is in C#.
    See more | Go to post

    Leave a comment:


  • cugone
    replied to Strip string before # (a charc)
    Because you did not mention what version of Visual Basic you are writing in, I'm going to assume 2005. :)

    Anyway, it's a very simple process to extract a string using the String.substrin g and String.IndexOf methods:

    Code:
            Dim address As String = "http://address/file.html#timmy"
            Dim strMemberName As String
            strMemberName = address.Substring(address.IndexOf("#")
    ...
    See more | Go to post

    Leave a comment:


  • Importing C# namespaces into a Visual Basic 2005 application

    I'm looking for a way to import C# namespaces (stored in a *.cs file) into a visual basic 2005 application. I'm attempting to write an application that uses DirectX and all of the helper functions and code for it are written in C#.

    The normal Imports keyword does not support pathnames as valid assemblies (I may just be doing it wrong, however) to search and the MSDN Library (April 2007 ed.) does not cover how to either.
    See more | Go to post
No activity results to display
Show More
Working...