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
  • Help me please...

    csharp help tutorial
    2
    0 Votes
    2 Posts
    0 Views
    D
    I've used this[^] library before. It's pretty good and gives you all the control you want. RageInTheMachine9532
  • Email "To" functionality - how to do?

    tutorial question
    2
    0 Votes
    2 Posts
    0 Views
    D
    After much searching, I haven't seen any controls that do everything you describe. Not even half of what you want, actually... If I were in your shoes, I would write the thing myself... RageInTheMachine9532
  • ReportEvent fails

    help
    2
    0 Votes
    2 Posts
    0 Views
    D
    The return value is zero because there was a failure. Use GetLastError to get the error number, then look that up here[^]. This is the System Error Codes list on MSDN. You might want to check the value returned by RegisterEventSource first. It looks like your not getting a good EventLog handle returned here. Your passing in an empty string instead of a 0 (which means NULL). This is where I think your problem is. If you change the call to this, it might work: hEventLog = RegisterEventSource("." & chr$(0), sSource) Again, if you get back a zero for either RegisterEventSource or ReportEvent, then use GetLastError to find out what the error was. RageInTheMachine9532
  • How to make the form moveable?

    question tutorial
    2
    0 Votes
    2 Posts
    1 Views
    D
    I have to question why this would be an issue? From what I can tell, the Moveable property has no effect at design time, only at runtime. The form in the designer is locked to the upper left corner of its document window, regardless of this property. Also, you can change the position of the form using the Top and Left properties, even when Moveable is false. I don't see how that window is moveable during design-time...:confused: RageInTheMachine9532
  • How to use CallByName function in VB.NET

    csharp tutorial
    2
    0 Votes
    2 Posts
    0 Views
    D
    CallByName lets you call a Function or manipulate a Property on an object, such as a TextBox or other class: CallByName(TextBox1, "Text", CallType.Set, "New Text")   CallByName(TextBox1, "Hide", CallType.Method)   Dim col As New Collection() ' Store the string "Item One" in a collection by ' calling the Add method. CallByName(col, "Add", CallType.Method, "Item One") ' Retrieve the first entry from the collection using the ' Item property and display it using MsgBox(). MsgBox(CallByName(col, "Item", CallType.Get, 1)) The down side to using the CallByName function is that it is very slow. There is also no type checking of arguments, so handling errors properly becomes a bit of a pain. RageInTheMachine9532
  • Excel in VB6

    help learning
    3
    0 Votes
    3 Posts
    0 Views
    J
    In order to enter values in the sample Excel sheet you sent over, I'd do one of three things: 1) Hard-code the cell addresses of the locations in the spreadsheet where you intend to place values, i.e., myWorkSheet.Range("B6").Value = rsTable("field").Value 2) Define each location in the template where you intend to store a value as a named range, then: myWorkSheet.Range("CashCollectionValueOne").Value = rsTable("field").Value 3) Store the relative addresses of each location in the formatted sheet in a cross-reference table, then lookup the location of a value in the cross-reference. What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
  • Passing data from datagrid to Dataset

    question database
    6
    0 Votes
    6 Posts
    0 Views
    J
    :cool: What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
  • my two simple problems

    question
    2
    0 Votes
    2 Posts
    0 Views
    I
    bensoncd wrote: How can I code a text box to accept characters of the alphabet, a spacebar (and a - for double barrel names) only? Ideally this text box is named txtName and is supposed to accept people’s names. You could run a regular expression on the contents of the textbox changing, and disable the OK button (or whatever) until the expression matches. bensoncd wrote: (2) In VB. NET how can I create a library of common procedures that I will constantly need to copy and paste to different projects Try creating a Class Library project. This allows you to create a .NET assembly (held in a DLL) that can contain your common code base. Ian Darling "One of the few systems...which has had “no deaths” in the reliability requirements." - Michael Platt
  • Setting a Leap year condition

    help data-structures json
    2
    0 Votes
    2 Posts
    0 Views
    I
    You might want to learn what the rules for leap years are: If the year is divisible by 4 then it's a leap year. However, if the year is also divisible by 100, then it is not, but it it's divisible by 400 then it is. Hence 2000, 2004, 2400 are leap years, but 1900 and 2100 are not. A leap year has one additional day, which is February 29th. ------------------ If you're using .NET, just use DateTime.Parse or something to see if the date entered is valid or not (as the DateTime APIs handle this stuff anyway, so you're better off using them). VB6 may have a similar API. Ian Darling "One of the few systems...which has had “no deaths” in the reliability requirements." - Michael Platt
  • Some guidance required

    database sql-server sysadmin help tutorial
    6
    0 Votes
    6 Posts
    0 Views
    A
    EXACTLY what i was looking for... thanks.
  • Inter-Application Communication

    question csharp dotnet xml help
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Help!! About Datagrid

    csharp help tutorial
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • VB.Net Webpage Info Download

    database csharp com tutorial
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Set Printer Using Printing API

    question com testing tools
    4
    0 Votes
    4 Posts
    0 Views
    E
    Thanks for that, Duncan. Can you please give me a suggestion on what I should investigate to set the printer stapling? (API, PCL Printer Commands, PJL, etc.) Edbert P. Sydney, Australia.
  • Printing Please Help

    csharp help question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Set Selected Item

    question
    3
    0 Votes
    3 Posts
    0 Views
    D
    Simple: ListView1.Item(<index>).Selected = True But, the ListView control also has to have the focus for the select highlight to show. Use this: ListView1.Select() ' Make the ListView the active control. ListView1.Item(<index>).Selected = True ' Select the items we want. RageInTheMachine9532
  • How to Insert Table in Rich Text Control

    help tutorial
    2
    0 Votes
    2 Posts
    0 Views
    J
    1. You can insert the RTF code using SelectRTF, you'd have get the basic code from wordpad, then modify it a bit. 2. Also you can (although I've not been able to get it to work myself), create a word object and add a table, see the newsgroups for example. However, even if you get point 1 working there is a problem. Tables cells don't word wrap in the richtextbox. I've been looking for a solution to this was a day or two. I've just been looking at the OLE Object example on this site, I thought I might be able to insert HTML, but I can't get it to work. Even if I could I'd then have a problem with resizing columns. I've just about ready to give up.
  • Time of Day Launched Project

    csharp sysadmin question
    3
    0 Votes
    3 Posts
    0 Views
    J
    Sometimes the simplest solutions are the least obvious... ;) What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
  • a problem in VB 6 (textbox.text)

    help
    4
    0 Votes
    4 Posts
    0 Views
    H
    Text1.Text = Left$(Text1, Text1.SelStart) + Right$(Text1, Len(Text1) - Text1.SelStart - 1)
  • 0 Votes
    1 Posts
    0 Views
    No one has replied