Luc001 77 Posting Whiz

hi all..

i did want to ask something
when i copy paste the whole code.. i get this..

Dim sb As New StringBuilder() >>> type 'StringBuilder' is not defined

can anyone help me please ??

Hi,

You need to add the proper namespace.

Imports System.Text
Luc001 77 Posting Whiz

Hi,

If you say the attempts is the same as gameplayed then you can change this part of code:

If attempts > 1 Then
            GamesPlayed = +1
            TextBox1.Text = GamesPlayed
        End If

into this:

If attempts = 5 Then
            MsgBox("You played 5 times!")
        Else
            attempts = attempts + 1
            TextBox1.Text = attempts
        End If

You should also think of to reset the attempts when the player select another level.

Luc001 77 Posting Whiz

Hi,

You can try this:

Private Shared ds As DataSet
Luc001 77 Posting Whiz

Hi,

How did you created your MDI application and do you open a ChildForm?

Luc001 77 Posting Whiz

Hi,

I think the best way is to create an application in the most common resolution and that's 800x600. The raison for that is to handle smaller rsolutions and then resize it based on the screen object.

You can try then this paart of code:

Dim h, w As Integer
h = Screen.PrimaryScreen.WorkingArea.Height
w = Screen.PrimaryScreen.WorkingArea.Width
Me.Width = w
Me.Height = h
Me.CenterToScreen()

or

Dim h, w As Integer
h = Screen.PrimaryScreen.Bounds.Height
w = Screen.PrimaryScreen.Bounds.Width
Me.Width = w
Me.Height = h
Me.CenterToScreen()
Luc001 77 Posting Whiz

Hi,

You can find an example, here.

Luc001 77 Posting Whiz

Hi,

I think the upgrade wizard doesn't work because of the complexity of your VB6 application. (74 forms)
What you could try is to use the wizard form by form and then build the application all together in VB.Net.

That said, when the wizard is working it's not always the best solution and it is possible that still need time to resolve some errors. So it's better to rewrite your application in the proper VB.Net syntax even when you need time to do it.

Luc001 77 Posting Whiz

Hi,

Did you tryed to rename it again to the original name.

Luc001 77 Posting Whiz

Hi,

No problem, glad to help :)

Mark your thread as solved :)

Luc001 77 Posting Whiz

i have a radio button and a text box. when i select the radio button, then will come out the text box to let user fill in. may i know to show the text box?
below are my coding.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
         TextBox2.Visible = True

        If RadioButton4.Checked = True Then
            TextBox2.Visible = True
        Else
            TextBox2.Visible = False
        End If


    End Sub
End Class

hope someone can help me. thx

Hi,

You can do it like this example.
Add a textbox and 2 radiobuttons then try it:

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        TextBox1.Visible = False
    End Sub

    Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged
        If RadioButton2.Checked = True Then
            TextBox1.Visible = True
        Else
            TextBox1.Visible = False
        End If
    End Sub
End Class
Luc001 77 Posting Whiz

Hi,

You can find some explanation, here.

And a walkthrough, here.

Luc001 77 Posting Whiz

Hi,

To read a TextFile into a ListBox you can do it like this:

// Load the ListBox from a file.
private void Form1_Load(System.Object sender, System.EventArgs e)
{
	try {
		string file_name = DataFile();
		System.IO.StreamReader stream_reader = new System.IO.StreamReader(file_name);

		ListBox1.Items.AddRange(Strings.Split(stream_reader.ReadToEnd(), Constants.vbCrLf));
		ListBox1.SelectedIndex = 0;
		stream_reader.Close();
	} catch (Exception exc) {
		// Report all errors.
		Interaction.MsgBox(exc.Message, MsgBoxStyle.Exclamation, "Read " + "Error");
	}
}

I doesn't use C# offen, but it should work thought.

Luc001 77 Posting Whiz

Hi,

To create a numeric textbox, look here.

To select a certain length, go to the properties of that textbox and set the Maxlength.

debasisdas commented: agree +13
Luc001 77 Posting Whiz

Hi,

How did you do the export format?
Can you show us your codes?

You can find some explanation, here.

Luc001 77 Posting Whiz

Hi,

No problem :)
Mark your thread as resolved, rating is a way of saying thank you! :)

Luc001 77 Posting Whiz

Hi,

You can try something like this:

ListBox1.Items.Add("Balnce: " & amount). ToString("0.00")
Luc001 77 Posting Whiz

Hi,

What you also can do is useDES Algorithm.
For more explanation, look here.

See also this thread.

Luc001 77 Posting Whiz

Hi,

You said it's not working.
Perhaps a little more explanation like:
what errors do you have?
...

Luc001 77 Posting Whiz

Hi,

You can drag and drop items in a Listview.
For more information, look here.

Luc001 77 Posting Whiz

Hi,

For more information about IIS, look here.

Luc001 77 Posting Whiz

Hi,

That error could be caused in the configuration of IIS.

What you can try is;
Change Classic mode by integrated mode in IIS options, and it should work then.

Luc001 77 Posting Whiz

Was wondering, is it possible to create a class which has the majority of your keypress controls?
Like allowing just letters or numbers in a textbox etc....

To make things clearer what i exactly want.

I have a textbox on my form.
This is a textbox for the postcode.
The postcode is supposed be something along the lines of AA 1234.
This will be checked on lostfocus.

But i need to code this in a class, and this is where i am stuck.

Hi,

When you says that you need to do it in a Class means for me that you need to create a Custom TextBox right.

You can find an example (Checkbox) how to create a custom Control, here.

If however it isn't really necessary you can try a MaskedTextBox.
Try this:

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        MaskedTextBox1.Mask = "LL 0000"
    End Sub

    Private Sub MaskedTextBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles MaskedTextBox1.LostFocus
        If MaskedTextBox1.MaskFull Then
            MaskedTextBox1.BackColor = Color.Tomato
            If MaskedTextBox1.MaskCompleted Then

                MessageBox.Show("Entry in mask is valid", "Valid Entry", MessageBoxButtons.OK, MessageBoxIcon.Information)

            End If
        Else
            MaskedTextBox1.BackColor = Color.White
        End If
    End Sub
End Class
Luc001 77 Posting Whiz

Hi,

Try this:

conn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\G-project Crab\GP\GP\Database1-2.mdb"

conn.Open()
Luc001 77 Posting Whiz

Hi,

You can find a tutorial how to create a databasehere.

It shows you also the differance between Access and SQL Server Express.

Luc001 77 Posting Whiz

Hi,

Why do you use thoose boxes for?

Luc001 77 Posting Whiz

Hi,

No problem :)
Mark this thread as resolved and rating is a way of saying thank you. Don't forget to rate always, thanks. :)

Luc001 77 Posting Whiz

i created loan table, and i m fetching loan amount of each employee in a label to see d actual loan amount then i have one text box where user will insert amount and remaining amount on deduction come in another label as balance amount.

Hi wenbnet,

You have a database for several employees (several records) and for each employee you you have several columns for the loan amount.

Where does the loan amount and insert amount comes from....

You see a lot of questions.

Can you show us your codes and what errors do you have.

Luc001 77 Posting Whiz

Hi,

For your first question.
It's working normal because you put it in the Timer Event.
That means every second the timer execute you'll have an item added into the Listbox.

What you can do is change the timer interval to the executiontime you need or put it into a Button event instead of timer.

For your second question, try this:

TextBox1.Text = Date.Now.DayOfWeek.ToString
Luc001 77 Posting Whiz

Hi,

No problem :)
Mark this thread as resolved and rating is a way of saying thank you. Don't forget to rate always, thanks. :)

Luc001 77 Posting Whiz

Hi,

Here's a small example how to draw a line on a panel and to clean the panel:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim redPen As Pen = New Pen(Color.Red, 2)
        Dim point1 As Point = New Point(10, 10)
        Dim point2 As Point = New Point(120, 180)
        Panel1.CreateGraphics.DrawLine(redPen, point1, point2)
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Panel1.Invalidate()
    End Sub
Luc001 77 Posting Whiz

Hi,

You can try this;

Dim oReg As RegistryKey = Registry.CurrentUser
   Dim oKey as RegistryKey = oReg.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Run", True)
   oKey.SetValue("MyVBApp", cPGM)
Luc001 77 Posting Whiz

Hi,

I think yoou can only send the generated file as attachment, but you can always write code that you can't change the specific Email ID.
See previous post how to send an Email.

Luc001 77 Posting Whiz

Hi,

To export a Crystal report to PDF, look here.

Luc001 77 Posting Whiz

thnk u vry much sir,
u done it.....

now plz help me in my thread

http://www.daniweb.com/software-development/vbnet/threads/364490

Hi,

No problem :)
Mark this thread as resolved and rating is a way of saying thank you. Don't forget to rate always, thanks. :)

Luc001 77 Posting Whiz

Hi,

You can try it like this:

Private Sub ListView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListView1.SelectedIndexChanged
        Dim SelectedItems As ListView.SelectedListViewItemCollection = _
            CType(sender, ListView).SelectedItems
        If (SelectedItems.Count > 0) Then
            Label1.Text = ListView1.SelectedItems(0).SubItems(0).Text
        End If

    End Sub
Luc001 77 Posting Whiz

Hi kitjo,

The application you made isn't that for a Mobile devices and you want to use it into PC?

Luc001 77 Posting Whiz

Hi,

I sould not use a Monthcalendar for this, but 2 Datetimepickers.
I made you a small example how I should do the calculation.

private void Button1_Click(System.Object sender, System.EventArgs e)
{
	System.DateTime d1 = DateTimePicker1.Value;
	System.DateTime d2 = DateTimePicker2.Value;
	TimeSpan ts = default(TimeSpan);
	ts = d2.Subtract(d1);
	if (!(ts.Days > 0)) {
		Label1.Text = ("There are " + ts.Days + 1 + " " + "days");
	} else {
		Label2.Text = ("There are " + ts.Days + " " + "days");
	}
	int pricePerDay = 39.0;
	Label2.Text = "Total is: " + (ts.Days * pricePerDay).ToString("C");

}

Because I'm not using C# offen is it possible that the're some errors in it.
Let me know if there some problems with it.

Luc001 77 Posting Whiz

Hi,

To export a Crystal Report to PDF.
You can find some information, here.

To send an Email, try this:

Dim mail As New MailMessage()
mail.To = "me@mycompany.com"
mail.From = "you@yourcompany.com"
mail.Subject = "this is a test email."
mail.Body = "this is my test email body."
Dim attachment As New MailAttachment(Server.MapPath("test.pdf")) 'create the attachment
mail.Attachments.Add(attachment) 'add the attachment
SmtpMail.SmtpServer = "localhost" 'your real server goes here
SmtpMail.Send(mail)
Luc001 77 Posting Whiz

Hi,

What errors do you have?

Luc001 77 Posting Whiz

Hi,

You can find some information how to create a crystal report with VB.Net, here.

Luc001 77 Posting Whiz

Hi,

You can try something like this:

Dim value As Long
        value = Convert.ToInt64(CardNo)
        Dim CNo As String = value.ToString("X")
        CNo.padleft(6, "0")

I didn't tested it.

Luc001 77 Posting Whiz

Hi,

Here's a way how to print the contents of a Label and TextBoxes.
For example add two labels to a panel and name them Students Name and Fathers Name.
Next to the Labels add two Textboxes where you can write the contents.
Then add two buttons and a PrintPreviewDialog and a PrintDialog.

Try this:

Imports System.Drawing.Printing
Public Class Form1
    Private WithEvents pndocument As PrintDocument

    Private Sub btnshowpreview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnshowpreview.Click
        Dim previewmode As New PrintPreviewDialog
        pndocument = New Printing.PrintDocument
        previewmode.Document = pndocument
        previewmode.ShowDialog()
        pndocument = Nothing

    End Sub

    Private Sub btnprint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnprint.Click
        pndocument = New PrintDocument
        pndocument.Print()

    End Sub

    Private Sub pndocument_Printpage(ByVal sender As Object, ByVal e As Printing.PrintPageEventArgs) Handles pndocument.PrintPage
        
        Dim prFont As New Font("Calibri", 24, GraphicsUnit.Point)
        
        e.Graphics.DrawString( _
        Label1.Text, prFont, _
        Brushes.Black, 30, 30)
        e.Graphics.DrawString( _
     Label2.Text, prFont, _
     Brushes.Black, 30, 70)
        e.Graphics.DrawString(TextBox1.Text, prFont, Brushes.Black, 300, 30)
        e.Graphics.DrawString(TextBox2.Text, prFont, Brushes.Black, 300, 70)
    End Sub
End Class

To print the proper format in the textboxes you need to ask the user to use the proper format.

Luc001 77 Posting Whiz

Hi,

You can find an example, here.

Luc001 77 Posting Whiz

Hi,

When you right click the Toolbox you need to select-> Choose item and then select the Com tab -> select Shockwave Flash Object.

Luc001 77 Posting Whiz

Hi,

You can find some information about how to add an Image/Loge into a Crystal Report, here.

Luc001 77 Posting Whiz

Hi,

You need to iterate through the DataGridView rows and for each row, cast the cell in the column of interest to DataGridViewCheckBoxCell and cast the Value to a bool.

Luc001 77 Posting Whiz

Hi,

You can find some good tutorials about programming VB 2010, here.

Those tutorials have a lot of explanation and code samples, etxc...

Then last but not least, you can learn from all threads in this Forum.
Ask a questions about programming and you'll get some answers.

Luc001 77 Posting Whiz

Hi AlexKid,

Glad to here that you found the problem.
Like I wrote you, I didn't tested it but was pretty sure that my code worked.

Grtz,

Luc001

Luc001 77 Posting Whiz

Hi,

If you want to open the Ieplore.exe in your application. You have to do it with Process.Start method.

Luc001 77 Posting Whiz

Hi,

You can find some explanation ans example, here to create a bar graph binded to a database.