Skip to content

Visual Basic

Visual Basic Questions

This category can be followed from the open social web via the handle visual-basic@forum.codeproject.com

34.4k Topics 120.1k Posts
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • Passing data between forms

    question
    7
    0 Votes
    7 Posts
    0 Views
    A
    Thank you for the explanation. What you're saying makes absolute sense. Your help is much appreciated. Thanks again, Andrew P.S What is a better way to pass data between mdiChild forms?
  • i want this function

    help
    4
    0 Votes
    4 Posts
    0 Views
    I
    elmahdy wrote: what is the best method ? I don't know. The scope of your question is outside what this forum is aimed at, and I'm not a music expert. Try searching on google? -- Ian Darling
  • How to suport my application with sounds

    tutorial
    2
    0 Votes
    2 Posts
    0 Views
    J
    Try the sndPlaySound()[^] API. "Blessed are the peacemakers, for they shall be called sons of God." - Jesus "You must be the change you wish to see in the world." - Mahatma Gandhi
  • Finding the End Of File

    question csharp
    2
    0 Votes
    2 Posts
    0 Views
    D
    this should help , make sure to put your text file's location where it currently says C:\mytest.txt . VbCode: Imports System.IO '/// at the top of your form's code window ^^^^. '///////////////////////////////////////////// Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Dim sReader As StreamReader = New StreamReader(New FileStream("C:\mytest.txt", FileMode.Open, FileAccess.Read)) Dim x As Integer = sReader.BaseStream.Length MessageBox.Show("The Length of the text file is: " & x & " Characters") While Not sReader.Peek Console.WriteLine(sReader.ReadLine) End While sReader.Close() End Sub hope that helps:) Vb: Public Function TwinsOnWay(ByVal twins As String) As String Select Case twins Case "Gender" Return "Two Girls" End Select End Function
  • File Download - web service

    com help
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • how solving the error cordbg.exe

    help debugging workspace
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • DataGridEx

    com question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • String to Integer?

    question
    3
    0 Votes
    3 Posts
    0 Views
    A
    If you want to convert a string to an int use Int32.Parse(mystring). If you want to validate input (requiring numeric values only, for instance) use regular expressions.
  • large Memory used in .NET application

    csharp debugging performance question
    3
    0 Votes
    3 Posts
    0 Views
    A
    Contrary to popular belief, automaticall memory management in .Net is not equivalent to 100% total resource clean up. Coders still have the responsability of freeing some resources through the Dispose() method. Use dispose whenever available if you want to reduce memory footprint and avoid thoses cases where Net programs' memory usage continuously grows over time. (A five form program should never reach 75 Mb (unless it deals with very large quantities of data like uncompressed 20MB+ images) if coding practices are good. Also, try minimizing the form in your example and see how much memory it is using (much less). This happens because at startup your program is assigned a large working set to account for any initialization the CLR and associated dlls might need.
  • Multiple Textboxes in same array

    question data-structures
    4
    0 Votes
    4 Posts
    0 Views
    I
    Well, there's probably an article on CP somewhere, but it's really simple - bung a datagrid on your form, then call SetDataBinding on it with your array: ' Example - display an array of 3 items in a datagrid Dim myArray as String(3) = { "Hi", "Hello", "Bonjour" } ' Haven't tested this, but should work ok DataGrid1.SetDataBinding(myArray, "") If you need something more complicated (eg, multiple columns), use a DataTable instead of an Array. All of this is documented in MSDN anyway. -- Ian Darling
  • ?? displaying data

    question data-structures
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Obtaining Focus in VB application

    windows-admin linux help
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • How to access active web page objects from VB application.

    com help tutorial
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • problem with VB.NET and XML web services

    help wcf xml csharp
    3
    0 Votes
    3 Posts
    0 Views
    A
    Thanks, I actually tried that and it gave me an option to save or open the file. I figured out why it wasn't working. I forgot to install some web components from the VS.NET install cd. Go figure. Thanks
  • vb script an open/close cd-rom

    question tools
    2
    0 Votes
    2 Posts
    0 Views
    A
    Try with your fingers.
  • Webclass question - VB6 and XP

    question windows-admin help discussion
    2
    0 Votes
    2 Posts
    0 Views
    D
    Why are you using Webclass? This was abandend by Microsoft and Webclass projects DO NOT convert to VB.NET. Webclasses were a good idea, but were a pain to use. I had nothing but problems with them. One project I was in the middle of developing just started to fail to compile after adding a couple lines of debug code. The failure was it couldn't resolve an external reference to a DLL that was used by the Webclass itself! I got to the point where I had to blow away the MACHINE and reload everything in order to get it to work again! My advice is to switch to VB.NET and save yourself the major headaches. RageInTheMachine9532
  • Best way to end a form

    performance help
    2
    0 Votes
    2 Posts
    0 Views
    D
    Someone correct me if I'm wrong here: If you didn't explicitly call the Win32 API function LoadLibrary(), you can't unload it. DLL load and unload is handled automatically by the runtime (in both VB and VB.NET.) When your App loads, the runtime attempts to resolve all external references and loads the appropriate DLL's automatically. Then your app is able to call the functions you wanted. When you're done using the resources of the DLL, it WILL NOT unload. This won't happen (automatically, anyway) until your Application quits because that's when your releasing your references to the DLL. RageInTheMachine9532
  • Enums and Attributes

    tutorial help
    3
    0 Votes
    3 Posts
    0 Views
    M
    The following function should work for you ... Imports System.ComponentModel Imports System.Reflection Private Function GetContentTypeValue(ByVal value As Colours) As String      Dim fi As FieldInfo = value.GetType.GetField(value.ToString)      Dim attributes As DescriptionAttribute() = CType(fi.GetCustomAttributes(GetType(DescriptionAttribute), False), DescriptionAttribute())      If attributes.Length > 0 Then           Return attributes(0).Value      Else           Return String.Empty      End If End Function
  • VBA & Excel & HTML

    help question html database
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied