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
  • VB.NET

    csharp help learning
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • VB.net propertygrid

    csharp css question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • showing method descriptions in VS

    visual-studio csharp tutorial question
    9
    0 Votes
    9 Posts
    0 Views
    M
    After a lot of pondering I finally decided to turn to my highest VB authority on this matter - Francesco Balena. Here's what he said for all those who asked me to keep them posted on this matter: ---- That feature is based on descriptions held in an XML file held in the same directory as the DLL containing the actual types and methods. To see what I mean, see all the DLLs and the pairing XML files in the C:\Windows\Microsoft.NET\Framework\v1.1.4322 folder The guys that say that it can be done only with C# are partially right, because C# makes it _easier_ to generate the XML files that the Object Browser (and Intellisense) use to store descriptions of each methods. The C# compiler has an option that gathers all the comments interspersed in code (in a special format) and generates the XML file that VS.NET uses. With VB you must generate this file manually. However, there is a tool at http://www.gotdotnet.com/team/vb/ that lets you do that with VB as well. It is true (unfortunately) that C# can do things that VB can't - most notably, operator overloading, unsigned integers, and unsafe code - but this feature isn't one of those. regards, Francesco
  • Programming Mouse Clicks

    help
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Gleaning a specific part out of a string

    data-structures help question
    2
    0 Votes
    2 Posts
    0 Views
    D
    Your description seems be a little vague and the code sample doesn't make much sense either, but we'll try this. What I think your doing is looking at the first four hex characters, or 3rd and 4th characters only (?) and doing some processing base on what you find. I THINK(!) your looking for something like this: (This example will look at the 3rd and 4th characters only!: ie. 17_08_) Dim i As Integer = 1 Dim b As String Do While i < icount ' Grab the 3rd and 4th characters of the Hex code. ' This assumes that the Hex code is ALWAYS 4 digits long! b = Hex(son(i).data).ToString().SubString(3, 2) Select b Case "08" MessageBox.Show("You found a fwd one") Case "12" MessageBox.Show("Go Home") Case Else MessageBox.Show("Unknown code found: " & b) End Select Remember that Hex will NOT return a value padded with 0's on the left. An integer (15) converted to hex will return F, not 000F. So this method will NOT work in all cases. There may be a better method for making this determination, but it depends ENTIRELY on the data that you have in son().data. RageInTheMachine9532
  • application dies

    question csharp help announcement
    5
    0 Votes
    5 Posts
    0 Views
    J
    Thanks again. I will give that a try. Jim
  • Image Program

    2
    0 Votes
    2 Posts
    0 Views
    D
    What kind of manipulation? There are volumes of books on various techniques for HUNDREDS of manipulations. Also, your going to have to be aware of pixel formats, color tables, transparency, ... :-) RageInTheMachine9532
  • Visual Basic .Net &amp; WindowsNT

    csharp question
    3
    0 Votes
    3 Posts
    0 Views
    D
    Sure. Make sure he's running Service Pack 6a and then install the .NET Framework available here[^]. RageInTheMachine9532
  • Execcmd with parameters

    help tutorial
    2
    0 Votes
    2 Posts
    0 Views
    D
    Try adding the full path to pairdisplay before you pass it to ExecCmd: Commands1 = "C:\Full\PathName\pairdisplay -x umount " & DriveLetter & " " & VolumeName & " > d:\apps\shadowapp\logs\pairdisplay4.txt" RageInTheMachine9532
  • Excel Wksheet Using Visual Basic

    help tutorial
    4
    0 Votes
    4 Posts
    0 Views
    D
    No problem! Thanks! RageInTheMachine9532
  • how to link 2 forms in vb.net[emergency]

    csharp tutorial question
    6
    0 Votes
    6 Posts
    0 Views
    U
    Say if you want to display form1 from form2. In the form2 create the instance of form1 - dim frm1 as new form1() and then frm1.show or frm1.showdialog will display the form - Sunil
  • Datagrid Rows Count

    database tutorial question
    4
    0 Votes
    4 Posts
    4 Views
    G
    it is much easier to handle data with a dataset. you can build the strucure of the dataset in memory and bind it to the grid. i think the grid is not a good container for data, it's just a input/output mask for something like a grid.
  • how to add icon in menu using vb.net easy way?

    csharp tutorial question
    2
    0 Votes
    2 Posts
    0 Views
    L
    If you make a menu and then click its properties, you have the option to make an image list. Do this and then add the images you want.
  • VB,NET client area/non-clientarea

    winforms design learning
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Help needed re: printing .txt file

    help tutorial csharp tools
    4
    0 Votes
    4 Posts
    0 Views
    D
    Fionn wrote: Still find it amazing that the creators of this could have left out the functionality to just click a button and automatically print a given file. That's because printing usually ISN'T done with a straight text file, but with files of many different formats containing all kinds of junk like formatting codes and graphics. RageInTheMachine9532
  • launching an application in vb to control powerpoint application

    help
    2
    0 Votes
    2 Posts
    0 Views
    D
    ALL of this functionality is already built into PowerPoint. Why would you want to "reinvent the wheel"? Basically, you'll be setting a reference to the Microsoft PowerPoint object Library and controlling it thru code. You can create your own Open dialog and pass that file on to the PowerPoint application object you create. Playing the slide show should be as simple as myPowerPointAppObject.Show(), or something to that effect. The only sticking point is going to be the timing box. You can implement the textbox that only takes numbers very easily, but your going to have to override the presentations built in timers to get the next slide to show up when you want. Basically, all the functionality you described can be done as part of the presentation itself. All you do in PowerPoint is hit F5 to start the presentation. Click a mouse button or hit any key to show the next slide... RageInTheMachine9532
  • Find out who woke me up in VB6

    question
    3
    0 Votes
    3 Posts
    0 Views
    U
    RageInTheMachine, that was a peace of cake! Thanks a lot!
  • working with hardware

    database csharp sql-server sysadmin hardware
    2
    0 Votes
    2 Posts
    0 Views
    D
    1. does anyone know how to capture the image from a digicam and insert into a SQL server database using vb .net? You might want to check out Windows Image Acquisition here[^]. No garantee that it will work with your camera though. It would appear that you have to check with the manufacturer of the camera to see what device drivers are available for it and any possible SDK's. You also might want to check for TWAIN compatibility. That should make your life much easier when using the WIA API's. Once you have the images, it's not that hard to put them into an SQL database. This[^] article describes the process for use with an Access database, but the concepts apply to SQL databases as well. 2. How to capture the signature file using a pentablet hardware using vb .net and save the image into SQL server? You're probably going to have to depend on the manufacturer for the SDK's and docs for this one. But, once again, when you get the image, the SQL part is easy. RageInTheMachine9532
  • calling vbscript from program

    winforms tutorial
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Custom Control

    3
    0 Votes
    3 Posts
    0 Views
    C
    If you want this functionality in a custom control here are the steps you need to follow: (from the documentation on Inheriting from Existing Windows Form Controls) 1) Create a Windows Executable or a Windows Control Library project. (in the end you'll want to use a Windows Control Library, but for my test I just created the control in a Windows Executable project) 2) From the project menu select Add Inherited Control. 3) Select Custom Control in the Add New Item dialog box. 4) Go into the code for your new control and modify it so that you are inheriting from the specific control (in our case TextBox). change Public Class MyColorTextBox Inherits System.Windows.Form.Control to Public Class MyColorTextBox Inherits System.Windows.Form.Textbox ... Now put in your code for the GotFocus() and LostFocus() events...as we did before. For my test I then put a TextBox control on the form of my test application. Then I went into the system generated code and changed the declaration of the Textbox to a MyColorTextBox. ie. change Me.TextBox1 = New Systems.Windows.Forms.TextBox to Me.TextBox1 = New WindowsApplication1.ColorTextBox Now what you really want to do is wrap your new control into a Windows Control Library so that you can just draw a MyColorTextBox on any form. But I'm not going to go into all of that here. Hopefully this is a good start for you.