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
  • registry for dummies

    question windows-admin
    12
    0 Votes
    12 Posts
    0 Views
    L
    thanks you guys....you really help me a lot.
  • Is there a customer control that can handle text and pictures

    sales tutorial
    3
    0 Votes
    3 Posts
    0 Views
    D
    Yeah, the RichTextBox control supports images inline in the document. It is basic functionality, but it works. You can search the web for other controls, like RichEdit, but most you'll have to pay for if you want to use them. RageInTheMachine9532
  • HELP!!!!! on Forms

    csharp html help tutorial
    2
    0 Votes
    2 Posts
    0 Views
    J
    I'm not totally clear on what you're trying to do. Are you trying to load MS Word documents in a Windows Form? What is the end result?
  • Call a form’s sub from a Sub Main()

    help
    5
    0 Votes
    5 Posts
    0 Views
    G
    Hi John, THANKS! It worked GREAT! :) Thanks, GregC
  • Image Scanning in VB with ADO conrol

    question
    3
    0 Votes
    3 Posts
    0 Views
    D
    Use ADODB to scan an image? Bottom line is -> you can't. That's not what ADODB does. Are you trying to capture an image from a video camera? If so, what kind? A QuickCam? For something like that, your going to need a SDK from the manufacturer of the camera to get at an image. Logitech has one that works with its line of QuickCams at http://developer.logitech.com. RageInTheMachine9532
  • Help Help Help Me in Combo,,Anyone

    help database
    4
    0 Votes
    4 Posts
    0 Views
    J
    OK, I created a new Access database with one table, called "States". Then I created a new form, with a ComboBox called cbStates. I added an OleDbConnection and OleDbDataAdapter to the form, and generated a DataSet called dsStates. In the Load of the form, I did this: Private Sub Form1\_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load daStates.Fill(dsStates, "States") cbStates.SelectedValue = "CA" End Sub This seems to work correctly. What is the difference between this scenario and what you are trying to do?
  • 0 Votes
    4 Posts
    0 Views
    R
    I use the code below to do what (I think) you need to do... 'Now set the combo to show the propDB stored in the .ini file For i = 0 To cmbPropDB.ListCount If cmbPropDB.List(i) = gstrPropDB Then cmbPropDB.ListIndex = i Exit For End If Next i The thing that might be causing it to work on my machine and not on yours is because I've set my combo box type to DropDownList - this means that the user can't type directly into the edit area, but must select from the list. Let me know a bit more info, and will see if can sort it out for you if you like... "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox
  • 0 Votes
    2 Posts
    0 Views
    H
    vb6 and ADO or Vb.Net and ADO.NET ? if vb6: check the AppendChunk method of the field object :) you can load the picture in an array then add it to that field.
  • Network Communication

    sysadmin csharp c++ asp-net
    4
    0 Votes
    4 Posts
    0 Views
    J
    xtremean wrote (via email): i...need to be able send text strings, .jpg and .bmp file types OK, so this might not be the simplest solution for a "newbie".... that being said, here's what I would imagine doing if I were writing a custom application to do this kind of thing: On the client side you'll have some kind of form, possibly attached to a NotifyIcon (for ease of use, like an IM client) that allows the user to select a file (or files). Using the File and FileStream you open up the client file, establish a NetworkStream connection to the server using TcpClient and TcpListener and use NetworkStream and FileStream on the server side to read the stream and write it to a file. The server is going to listen on several ports for several incoming connections, each connection a TcpListener running on its own thread, so there would be the need to start each on its own, using Asynchronous callbacks and the IAsyncResult interface. At a network level, if it is over the Internet, you might consider a establishing a VPN connection between the client location and the server location, which should protect and encrypt the transfers and prevent having to write code dealing with that aspect of things. Then again, you could establish an FTP site somewhere and get WS_FTP Pro, or something, and enable people to upload to the FTP site. This can even use SSL for encryption, protecting the confidentiality of the information being passed.
  • Simple Problem With ListBoxes

    help
    4
    0 Votes
    4 Posts
    0 Views
    J
    Something like this -- though bear in mind this needs to be refined, as it will error out if there are less than items currently populated in the list, and items should be defined as the total number of list items the list is capable of displaying. Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Dim items As Integer Dim averageHeight As Integer items = 14 averageHeight = List1.Height / items For i = 1 To items If Y > (((i - 1) * averageHeight) + 1) And Y < (i * averageHeight) Then List1.ListIndex = i - 1 End If Next If Button = 2 Then Form1.PopupMenu rclOne End If End Sub
  • Combobox and Database

    question database help
    2
    0 Votes
    2 Posts
    0 Views
    P
    Create two data adapters. One with just the displayed and key field or unique field selected. And another with all the fields selected and in the key field or unique field under criteria put a "=?" no quotes. Then create datasets for both. Then you need to create Functions either in a component module or just in your forms code. They could look something like this. This is from a component *************************************************************************** Public Function getdataset(ByVal strValue As String) As DataSet 'fill the dataset DsGuests1.Clear() daGuests.SelectCommand.Parameters("Phone").Value = strValue NOTE:The "Phone" parameter will just be your unique field daGuests.Fill(DsGuests1) Return DsGuests1 End Function Public Function GetNames() As DataView 'fill the dataset daNames.Fill(DsNames1) Return dvNames End Function *************************************************************************** Then you are going to have to set up the combo box to get the displayed names by calling your dataset and putting it into a dataview object with just the displayed field as the Display Member and the Unique key field as data member when the form loads. Could look something like this. *************************************************************************** Dim dvnames As DataView dvnames = mobjguests.GetNames With Combobox1 .DataSource = dvnames .DisplayMember = "FullName" .ValueMember = "Phone" .SelectedIndex = -1 End With NOTE: mobjguests was the name of my component it would be just a procedure of getnames if you were using the form and would just be dvnames = GetNames *************************************************************************** After the names are filled in the list and you then need to set up a Combobox indexChanged event. This will call the dataset with all of the fields in it and will send the data member part of your combobox to the function. After this you are going to have to bind each of you data fields to a textbox or whatever you choice and all of this will looks something like this. *************************************************************************** Private Sub cboNames_SelectedIndexChan
  • error BC30652: Reference required to assembly

    csharp help question
    2
    0 Votes
    2 Posts
    0 Views
    D
    Yeah. Fixed by adding a Reference in Project C, to Project A. In Project C, right click on the References folder, click Add Reference. Then click on the Projects tab and select the project you want to reference, A in your case. Click Select, then OK. RageInTheMachine9532
  • How to change ethernet transfer settings

    tutorial question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Runtime error

    help csharp dotnet tutorial
    4
    0 Votes
    4 Posts
    0 Views
    G
    no i am not using any api's. but still problem exists nothing now.
  • Collection Objects

    question
    2
    0 Votes
    2 Posts
    0 Views
    J
    Here are the options I know of: 1) You can write your own custom class that "inherits" the VB6 collection object. Of course VB6 doesn't really inherit, you simply wrap calls to the collection object with methods of your own class (is that a wrapper or a decorator...) 2) You can write a method of that class that searches through the collection for a particular value. 3) You can look around for a custom control or library written by someone else.
  • Setting Default filename in Excel fileSaveAs Dialog

    csharp help question
    2
    0 Votes
    2 Posts
    0 Views
    J
    The syntax "Argl:= fName" shouldn't work in VB.NET. I believe that you simply pass the file name to the show method. Also, several people have written introductions to using Excel and Word in VB.NET and C#, you might try those if you have other problems.
  • 0 Votes
    1 Posts
    0 Views
    No one has replied
  • Query as input for my array?

    database question data-structures
    2
    0 Votes
    2 Posts
    0 Views
    D
    Dim conn As New SqlConnection(''''YourConnectionStringHere) Dim cmd As New SqlCommand Dim dr As SqlClient.SqlDataReader With cmd .Connection = conn .CommandType = CommandType.Text .CommandText = "SELECT ExeName FROM tProcessNames" .Connection.Open() dr = .ExecuteReader(CommandBehavior.CloseConnection) While dr.Read buildProcess(dr.Item("ExeName").ToString) End While End With dr.Close() If I understand you right that should do it. Hope it helps
  • I NEED HELP..NEED A GURU

    csharp help tutorial question
    2
    0 Votes
    2 Posts
    0 Views
    M
    Try using directsound, you will need the directx SDK.
  • DirectDraw in VB.NET

    tutorial csharp graphics help
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied