Luc001 77 Posting Whiz

Hi,

You can find a tutorial, here.

Luc001 77 Posting Whiz

Hi,

You can try something like this:

If Me.txtLine2Rcon.Text = "" Then MsgBox("Please insert a running condition for Line 2 before you add it to the database", vbOKOnly)
        End Sub
else
        Dim NewLongDesc As String
        Dim RConv As String
        Dim StkCodeV As String
        ' rest of your code
Luc001 77 Posting Whiz

Hi,

If that solved your problem mark your thread as solved.

Luc001 77 Posting Whiz

Hi,

I think you can find some information, about cursors, here.

He also mentioned that you can create some cursors by yourself with Visual Studio.

Luc001 77 Posting Whiz

Hi,

No problem.

If that solution solved your problem then mark your thread as resolved.

Luc001 77 Posting Whiz

Hi,

You can find some more Time format structures, here.

Luc001 77 Posting Whiz

Hi,

No it's always first the date and then the time.

After some testing found this:

Dim date1 As Date = #3/7/2008 7:00:00 AM#
        Label1.Text = date1.ToString()
        Dim date2 As Date = #3/7/2008 7:00:00 AM#
        Label2.Text = date1.ToString(System.Globalization.CultureInfo.CreateSpecificCulture("en-US"))
tcon commented: a combination of your posts lead me to a solution when i pieced bits of code together. i will post the final solution soon :) +1
Luc001 77 Posting Whiz

Hi,

You can find some information and example how to create a Chat program with vb.Net, here.

Luc001 77 Posting Whiz

Hi,

I think that your sytem time isn't the US time format.
To change the forùmat into US time format use this:

Imports System.Globalization 

        Label1.Text = Date.Now.ToString("hh:mm:ss tt MM/d/yyyy", CultureInfo.CreateSpecificCulture("en-US"))

Hope it helps.

Luc001 77 Posting Whiz

Hi,

If I understand correct then it's this you want to accomplish:

TextBox1.Text = Now.ToString("hh:mm:ss: tt")

TextBox1.Text = Now.ToString("M/dd/yyyy")
Luc001 77 Posting Whiz

Hi,

You can do it like this:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
     TextBox1.Focus()
     ' put your code for the button click event here
End Sub
Luc001 77 Posting Whiz

Does anyone know where can I download free controls for my vb 2008? I need other controls that are more fancy or cool. My new proposed system is a multimedia file player and I think the common controls found in my IDE are not sufficient.

Hi,

You can try here.

Luc001 77 Posting Whiz

codes pls.

the format should be like this.

DATE: TEXTBOX1 = month/date/year
TIME: TEXTBOX2 = time
DAY: TEXTBOX3 = day today

pls help me.
needed ASAP.

Hi,

You can do it like this:

TextBox1.Text = Date.Now.ToShortDateString
        TextBox2.Text = Date.Now.ToShortTimeString

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

Hello Airgear,

I think your confusing with your own created codes and the codes you found in some Amazon books. If that's the problem, then you need a license to use thoose codes.

Luc001 77 Posting Whiz

Hi,

Then you can try this:

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
        If e.KeyChar = Chr(13) Then
            TextBox2.Focus()
        End If

    End Sub
Luc001 77 Posting Whiz

I added 2 textboxes on the form and runs it...I pressed the enter after I type in simple text.. it will not goto next textbox but tab can do .. why ... no nay code.. strange....
Thanks

Hi,

You can try something like this:

Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
        If e.KeyChar = Chr(13) Then
            TextBox2.Text = TextBox1.Text
        End If

    End Sub
Luc001 77 Posting Whiz

Hi,

You can find some explanation how to use the toolstripbutton control, here.

Luc001 77 Posting Whiz

Hi,

If it solved your problem mark this thread as resolved.

Luc001 77 Posting Whiz

Hi,

You can find some tutorial, here.

Luc001 77 Posting Whiz

Hi,

If your using that part of code like this:

YourTextBox.AutoCompleteCustomSource.Add(YourDataSet.Tables("Table").Rows(i).Item(Required)

Then of course you have some difficulties:

What's the name of your textbox....
What's the name of your Dataset....
What's the name of your Table....
Required.....

Change that and see what's happening with the Error...

Luc001 77 Posting Whiz

Hi,

You can find a tutorial, here.

Luc001 77 Posting Whiz

Hi,

You doesn't need a timer for this.
Here's an example:

Private Sub Form1_Mousedown(ByVal sender As System.Object, ByVal e As _
System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
If e.Button = MouseButtons.Left Then
MsgBox(" You clicked the Left mousebutton")
End If
End Sub
Luc001 77 Posting Whiz

Hi,

You can find at the documentation what members the ListView class has. The documentation lists all the members and describes the SelectedIndices property.
So, your a couple of clicks away from the solution...

Luc001 77 Posting Whiz

Hi,

You can try this:

- Change the Format Property of the DateTimePicker to "Custom"
- Write the Following in the CustomFormat property: 01.MM.yyyy

Luc001 77 Posting Whiz

Hi,

You can't do that or you should create your own Label.

Is there a raison to use a Label, because the Listbox is created for that with VScrollbar.

Luc001 77 Posting Whiz

Hi,

I never used something like that, but I'll try to give you an idee how I would do it.

I should say that the login form is a normal Login form with admin and Non- Admin usernames and passwords.
The logic will be in the Ms- Access database itself.

For example, if there's a Non- Admin login then the database will be Read- Only or allowed to do some changes in that database, for Admin logins then you have full autority to do some changes in that database.

Just a thought.

Luc001 77 Posting Whiz

Hi,

No you can't, because there can be only one parentform in a MDI application.

Luc001 77 Posting Whiz

Hi,

Add a button and a new form to your application and name it Child1, then you can try something like this inside the button click event:

Dim f As New Child1
        f.MdiParent = Me
        f.Show()
Luc001 77 Posting Whiz

Hi,

Because I'm using still Windows XP, I can't do some test to try to help you on this.
That's why I gave you that link in the hope it could help you.

Luc001 77 Posting Whiz

Hi,

You can find an example how to drag and drop a textfile, here.

I hope it helps.

Luc001 77 Posting Whiz

Hi,

You should use the Button.Performclick() event for that instead of select.

Luc001 77 Posting Whiz

Hi,

You can find some information, here.

Luc001 77 Posting Whiz

Hi,

No problem glad to help, mark your thread as solved.

Luc001 77 Posting Whiz

Hi,

You can find a password generator with numbers and upper- and lowercase characters, here.

Luc001 77 Posting Whiz

Hi,

You can do it also with times used, look here for an example.

Luc001 77 Posting Whiz

Hi,

Or you can use the application StartupPath.

'First , add reference to ShockWave Flash Object Library
'existed on the COM Tab . Paste the control on your form.
'Use the code below as follow : 
'Add your flashfile to the Bin folder

Public Class Form1
    Inherits System.Windows.Forms.Form

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        With FlashObj
            .Stop()
            .Movie = Application.StartupPath & "\nameofyourflashfile.swf"
            .Play()
        End With
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        FlashObj.Dispose()
        Application.Exit()
    End Sub


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

    End Sub
End Class
Luc001 77 Posting Whiz

Hi,

No problem glad to help, mark your thread as resolved.

Luc001 77 Posting Whiz

Hi,

Try something like this:

Dim theConnection As New OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;data source=book1.xls;Extended Properties=""Excel 8.0;HDR=NO;IMEX=1;""")
theConnection.Open()
Dim theDataAdapter As New OleDbDataAdapter("SELECT * FROM [Sheet1$]", theConnection)
Dim theDS As New DataSet()
Dim dt As New DataTable()
theDataAdapter.Fill(dt)
Me.dataGridView1.DataSource = dt.DefaultView
Luc001 77 Posting Whiz

Hi,

You can try this:

Label1.Text = ListView1.Items.Count()Label1.Text = ListView1.Items.Count()
Luc001 77 Posting Whiz

Hi,

You can work around and use enabled and set backcolor to white.
Here's an example:

For Each ctrl As Control In Me.Controls
            If TypeOf ctrl Is TextBox Then
                ctrl.Enabled = False
                ctrl.BackColor = Color.White
            End If
        Next
Luc001 77 Posting Whiz

Hi,

You should read this thread.

Luc001 77 Posting Whiz

Hi,

I don't know of an easy way to do it using a ListBox control.
I would use a ListView control instead. This typically gives
you more features anyway, not to mention. From what I have discovered using the ListBox control, you can only set the ForeColor for the entire control, not the individual items within the control.
If you would like to use the ListView control instead, here some sample code to do what you wanted to do.

Just drag a ListView control onto your form, or build it dynamically,
whichever you prefer, and then add the following code:

Private Sub BuildListView
Dim i As Integer
ListView1.View = View.Details
ListView1.Columns.Add("Column1", 200, HorizontalAlignment.Left)
For i = 0 To 3
Dim x As New ListViewItem
Select Case i
Case 0
x.Text = "Red text goes here..."
x.ForeColor = System.Drawing.Color.Red
Case 1
x.Text = "Blue text goes here..."
x.ForeColor = System.Drawing.Color.Blue
Case 2
x.Text = "Green text goes here..."
x.ForeColor = System.Drawing.Color.Green
Case 3
x.Text = "Black text goes here..."
x.ForeColor = System.Drawing.Color.Black
End Select
ListView1.Items.Add(x)
Next i
End Sub

I hope it will help you in right direction.

Luc001 77 Posting Whiz

Hi,

No problem glad to help.
Mark it as solved.

Luc001 77 Posting Whiz

Hi,

You could use something like this:

Dim x As Integer
        Dim y As Integer
        Cursor.Position = New Point(x + 2, y) 
       Cursor.Position = New POint(X, Y +2)
Luc001 77 Posting Whiz

Hi,

Here's a way how to detect the color in a shape.
Add a label to show the color.

Public Class Form1
    Public path As New System.Drawing.Drawing2D.GraphicsPath
    Public thecolor As Color = Color.Aqua
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        path.AddEllipse(20, 160, 50, 50)

    End Sub

    Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
        If path.IsVisible(e.X, e.Y) Then
            Label1.BackColor = thecolor
        End If
    End Sub
    
    Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
        Dim brl As SolidBrush
        brl = New SolidBrush(thecolor)
        e.Graphics.FillPath(brl, path)
                
    End Sub
End Class
Luc001 77 Posting Whiz

Hi,

Here's an example how to create an Ellipse and show the same color as the pixel color.

Public Class Form1

    Public MyColor As Color
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub PictureBox1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseClick
        PictureBox1.Image = My.Resources. your picturename
        Dim TempBitmap As New Bitmap(PictureBox1.Image)
        MyColor = TempBitmap.GetPixel(e.X, e.Y)
        Me.Invalidate()
        End Sub
    
    Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint

        Dim g As Graphics = e.Graphics
        Dim brs As SolidBrush
        brs = New SolidBrush(MyColor)
        g.FillEllipse(brs, 20, 20, 50, 50)
        
    End Sub
End Class
Luc001 77 Posting Whiz

Hi,

You can use an Imagelist to do so, and then show the images into your panel.

You can find some explanation, here.

Luc001 77 Posting Whiz

Hi,

Here's an example how to do this.

Public Class SplitTest
    Public Shared Sub Main()
        Dim words As String = "This is a list of words, with: a bit of punctuation" + _
                              vbTab + "and a tab character."
        Dim split As String() = words.Split(New [Char]() {" "c, ","c, "."c, ":"c, CChar(vbTab) })

        For Each s As String In  split
            If s.Trim() <> "" Then
                Console.WriteLine(s)
            End If
        Next s
    End Sub 'Main
End Class
Luc001 77 Posting Whiz

Hi,

You can find a complete database with several buttons to navigate into a database. Even with the whole explanation. Look here.

Luc001 77 Posting Whiz

Hi,

Show us your codes and we could help you more.