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
  • How do I save to file?

    help question
    6
    0 Votes
    6 Posts
    0 Views
    M
    Thanks to everyone for their help! This is what I ended up using: Private Sub cmdSave_Click() 'When users clicks Save 'note: the entire file is stored in a string CommonDialog1.Filter = "Hex files (*.HEX)|*.HEX" CommonDialog1.ShowSave 'display Save dialog If CommonDialog1.FileName <> "" Then Open CommonDialog1.FileName For Output As #1 Print #1, txtOut.Text 'save string to file Close #1 'close file End If End Sub
  • Outlook Bar

    learning
    4
    0 Votes
    4 Posts
    0 Views
    G
    A very good outlook Bar here + other forms controls : http://www.divil.co.uk/net/
  • 0 Votes
    3 Posts
    1 Views
    R
    Windows XP doesn't have the framework by default. Allegedly it will find its way into an upcoming service pack. Not sure about 2003 though, you may be right.
  • How to import Data from MPP

    tutorial
    2
    0 Votes
    2 Posts
    0 Views
    A
    I myself found something on MSDN that I can get object of MSPRJ9.obl. And then I can create object MPP. But anybody knows is that Object Library is distributable. Regards, Samya
  • bubbling events up.....is there a better approach?

    c++ com tutorial question
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Execution from server

    sysadmin csharp debugging tutorial
    2
    0 Votes
    2 Posts
    0 Views
    W
    How are you sharing the file? Have you put it in a shared directory? Are the other boxes set up with user accounts on the XP box? What path do you have in the shortcuts properties? Can you see the file on the network? Have you tried registering the DLL on the problem box? Regards Wayne Phipps ____________ Time is the greatest teacher... unfortunately, it kills all of its students LearnVisualStudio.Net
  • Showing a form inside a control

    question csharp
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • OutOfMemoryException

    help question
    3
    0 Votes
    3 Posts
    0 Views
    R
    Dim frmChild As Form = New frmAffiliationRegistration() Private Sub MenuItem12_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem12.Click frmChild.Dispose() frmChild= Nothing frmChild = New frmAdjudicatorRegistration() frmChild.MdiParent = Me frmChild.Enabled = True frmChild.Show() End Sub 'Is it Working???
  • Plug-in for MS Outlook. please help

    help tutorial discussion
    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • Speech recognition

    help
    2
    0 Votes
    2 Posts
    0 Views
    A
    OK. What are you looking for help with?
  • Implementing Pointers in VB.NET?

    help csharp wpf wcf
    3
    0 Votes
    3 Posts
    0 Views
    M
    Thanks for your suggestion, but unfortunately the references are still lost, and it would appear when the control and object are passed into the collection, they are passed copies. Sorry for leading you up the garden path by using that .Clone(), I was experimenting in the code - needless to say that didn't work. Anyhows, have implemented exactly what you specified, and the behaviour suggests that you cannot have a reference to a reference!!! In the good old days when I were but a young lad, and sweets were a penny each, and mobile phones were the size of a house, I could just use StrPtr(), but this feature has been ripped out of .NET...........:-(
  • Global Variables

    question
    7
    0 Votes
    7 Posts
    0 Views
    L
    create a new class called GlobalVariables or what ever you like Then put the variables that you would like to call this is C# code I created a new Class called GlobalVariables.cs on that page the only code that I have is public class GlobalVariables { public string ReportSection = ""; public GlobalVariables() { } } just because I didnt heed it to do anything else. Now on any page that I like I can do this: create an instance of that class GlobalVariables MyVariables = new GlobalVariables(); now assign the values MyVariables.ReportSection = ""; that should do it, William O'Malley
  • Crystal Reports

    help question
    6
    0 Votes
    6 Posts
    0 Views
    M
    Hi, I found this really helpful... http://www.crystalreportsbook.com/ Hope that helps, Martin
  • Showing Form

    question csharp testing beta-testing
    2
    0 Votes
    2 Posts
    0 Views
    N
    This should work: You have to create an instance of the other form before you can change properties on it. Dim otherForm As New Form2() otherForm.Show() otherForm.TextBox1.Text = "hello" Beware the chickens, for in their silence, they plot... Life is too short to be taken seriously. -- Oscar Wilde
  • Resizing Form Having Many Controls

    performance help question
    4
    0 Votes
    4 Posts
    0 Views
    D
    500 CONTROLS?! :wtf: I'd look at that and close the window immediately and the entire app shortly thereafter and write it off as being way to convoluted. How about breaking some of that up into multiple forms. Coding for every one of these must be a real pain? Even to just get values! RageInTheMachine9532
  • Auto hiding/docking windows

    question csharp visual-studio
    2
    0 Votes
    2 Posts
    0 Views
    W
    It depends how far you wany to go. Take a look at the following article. It demonstrates how to popup a graphic. You should be able to adopt a similar technique with any form. MSN Messenger-like popup Regards Wayne Phipps ____________ Time is the greatest teacher... unfortunately, it kills all of its students LearnVisualStudio.Net
  • read write file

    c++ ios tutorial question
    2
    0 Votes
    2 Posts
    0 Views
    D
    well you could write to a file / create and write in vb.net like this... VbCode: Private Sub Button1\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim writer As IO.StreamWriter = New IO.StreamWriter(New IO.FileStream("D:\\my.html", IO.FileMode.OpenOrCreate)) writer.Write(RichTextBox1.Text) writer.Close() Process.Start("D:\\my.html") End Sub or to read / still be able to write .... VbCode: Private Sub Button2\_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim reader As New IO.StreamReader(New IO.FileStream("D:\\my.html", IO.FileMode.OpenOrCreate, IO.FileAccess.ReadWrite)) While Not reader.Peek RichTextBox1.AppendText(reader.ReadLine & Environment.NewLine) End While reader.Close() End Sub hope it helps Vb: Public Function TwinsOnWay(ByVal twins As String) As String Select Case twins Case "Gender" Return "Two Girls" End Select End Function
  • Outlook VBA question

    question tutorial
    1
    0 Votes
    1 Posts
    0 Views
    No one has replied
  • Enter as default key

    design question
    4
    0 Votes
    4 Posts
    0 Views
    D
    Be careful how you use the terminology. There is no such thing as a "Default Property" in the .NET Framework. What you are looking for is in the Form Properties. Click on the Form you are using to get the UserName and Password. Under the Misc section in the Properties window you will find AcceptButton and CancelButton. You can assign which button does what and the form will automatically process the ENTER and ESC keys as Accept/OK and Cancel. Now, to get the OK button to LOOK like a Default button you have to call the NotifyDefault method on the button, probably in the Form's Load event, like this: Private Sub AuthForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load OKButton.NotifyDefault(True) End Sub This will force the button to draw itself with the thicker border of the default button. RageInTheMachine9532
  • Database Backup to CD-R

    question csharp database
    2
    0 Votes
    2 Posts
    0 Views
    D
    Emile Jacobs wrote: What is the best way to backup a database used in a project to a CD-Writable? We want to put in an option in our VB.NET program to burn the database on a CD. If you are using only Windows XP based machines, you can use IMAPI, which is a very easy way for VB programmers, because it's avaliable as a bunch of COM components. But if you want broader OS scope, you'll need to use Nero's APIs. // Quantum sort algorithm implementation while (!sorted) ;