1

Hmm. I'm not entirely liking the new design.
It's looks enlarged as if you're using the accessibility tools in Windows.
We're not blind or elderly. You can tone down the bloatiness of it. And the font size.
In fact, I liked the previous design better than this, and the one before that even more.
To me it seems to be getting worse and worse every time a new design gets published.

Comments
I'm elderly and part-way to going blind
1

I'm not entirely sure if it's possible to have it both ways.
Allow the server to maintain the established connection between each client talking to each other, but to also establish a direct connection between the clients for sending of messages.

That would permit the server to run that connection timer and send instructions to each client ordering them to terminate the connection to each other. And also for the clients to have that close-to-real-time communication you want.
But it requires each client to run two threads, one listening to the server and the other for talking to the other client.

1

Do you know for a fact whether or not the recovery partition doesn't contain the factory install of Win7?
If it does you can just find the correct button to press/hold while booting and reset the system.

Otherwise, go right ahead and remove it all.
You can do that during the install of Win7. Just hit the big Custom button and remove any and all partitions from there, and create a new one as you see fit.

1

This is a fully working code.
I noticed one thing that caused problems. The column name Size is a reserved word, so you need to put brackets [] around it.

Imports System
Imports System.IO
Imports System.Text
Imports System.Data.OleDb

Public Class frmBirthdayCake
    Private sql As String = "SELECT CakeID,Cake_Name,Cake_Description,Weight,Price,Image,ShelfLife,[Size],NoOfServings FROM Birthday_Cake"
    Private dt As New DataTable
    Private con As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\CakeAlbum.accdb")
    Private adapter As New OleDbDataAdapter(sql, con)
    Dim index As Integer

    Private Sub frmBirthdayCake_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        con.Open()
        adapter.Fill(dt)

        DataGridView1.DataSource = dt
        DirectCast(DataGridView1.Columns("Image"), DataGridViewImageColumn).ImageLayout = DataGridViewImageCellLayout.Stretch

        For i As Integer = 0 To dt.Rows.Count - 1
            Dim row As DataGridViewRow = DataGridView1.Rows(i)
            row.Height = 60
        Next

        DataGridView1.Columns("Image").Width = 150
        con.Close()
    End Sub

    Private Sub btnNext_Click(sender As System.Object, e As System.EventArgs) Handles btnNext.Click
        If TextBox1.Text = "" Then
            index = 0
        ElseIf index = dt.Rows.Count - 1 Then
            Exit Sub
        Else
            index += 1
        End If

        TextBox1.Text = dt.Rows(index)(0)
        TextBox2.Text = dt.Rows(index)(1)
        ReadImage()
    End Sub

    Private Sub btnPrevious_Click(sender As System.Object, e As System.EventArgs) Handles btnPrevious.Click
        If TextBox1.Text = "" OrElse index = 0 Then
            index = 0
        ElseIf index = dt.Rows.Count - 1 OrElse index <> 0 Then
            index -= 1
        End If

        TextBox1.Text = dt.Rows(index)(0)
        TextBox2.Text = dt.Rows(index)(1)
        ReadImage()
    End Sub

    Private Sub ReadImage()
        Try
            Dim imageBytes() As Byte = CType(dt.Rows(index)(2), Byte())
            Using ms As New MemoryStream(imageBytes)
                PictureBox1.Image = Image.FromStream(ms)
                PictureBox1.SizeMode = PictureBoxSizeMode.StretchImage
            End Using
        Catch ex As Exception

        End Try
    End Sub

    Private Sub DataGridView1_CellMouseClick(sender As Object, e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DataGridView1.CellMouseClick
        TextBox1.Text ...
Comments
thanks a lot this works!!!
2

You need two string variables.

You can perform a line read using the appropriate filereader object and append the line into a temp string variable through a simple loop.
And for each line you can in addition perform some string manipulation.
So for each line the only contains "" or " ", you can skip to the next line so that empty lines do not get read into the permanent string variable.

Additionally, during the manipulation phase you can do a simple string replacement.
:'++' becomes vbNewLine (or vbCrLf) and so on.
By using two variables you can append the last know good string to the "real" string.

The String object contains a whole bunch of useful tools to do exactly what you're asking for.

1

Just for kicks.
Try putting that code in a separate method and call it from the Load method.
But also include a class boolean variable.

Private bIsLoading As Boolean = True

Private Sub frmcrc_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    If bIsLoading Then
        LoadValues()
    End If
    bIsLoading = False
End Sub

Private Sub LoadValues()
    'Your code
End Sub

This is just to make sure that the code is not being executed twice.
I've had the happen to me once or twice when I had some code in the Form_Load event.

1

If you create and add controls through code then those controls will not have any events tied to them.
When you open the second and third panels and create controls in them, you also have to use the AddHandler statement and tie that to the txbUM_KeyDown event, or use a generic event and tie all three textboxes to it using AddHandler.

'For panel 2
AddHandler txbUM2.KeyDown, AddressOf txbUM_KeyDown

'For panel 3
AddHandler txbUM3.KeyDown, AddressOf txbUM_KeyDown

Like that.
And in the event itself you can use sender to identify which textbox triggered the event by using CType.

Dim tbox As TextBox = CType(sender, TextBox)
1

The question mark (?) was just an indicator telling you to put a numeric value there.
A question mark is also known as an "unknown". :)

Auto is not a property, it's a valid value to simply allow the container to expand depending on whatever the size of the content without regards.

1

Something like this:

Private Sub CopyToAccess(source As DataTable)
    Try
        Dim connString As String = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccess2007file.accdb;Persist Security Info=False;"

        Dim accConnection As New OleDb.OleDbConnection(connString)
        Dim selectCommand As String = "SELECT <field1>, <field2> and so on FROM <table>"
        Dim accDataAdapter As New OleDb.OleDbDataAdapter(selectCommand, accConnection)

        Dim accCommandBuilder As New OleDb.OleDbCommandBuilder()
        accDataAdapter.InsertCommand = accCommandBuilder.GetInsertCommand()
        accDataAdapter.UpdateCommand = accCommandBuilder.GetUpdateCommand()

        Dim accDataTable As DataTable = source.Copy()

        ''Just to make sure, set the RowState to added to make sure an Insert is performed'
        'For Each row As DataRow In accDataTable.Rows'
        '    If row.RowState = RowState.Added Or RowSate.UnChanged Then'
        '        row.SetAdded()'
        '    End If'
        'Next'

        accDataAdapter.Update(accDataTable)
    Catch ex As Exception
    End Try
End Sub
1

Alright.
You want to convert the text into HTML entities.

This function should do it:
[CODE]
Private Sub SomeMethod()
Dim file As New StreamReader("filename", Encoding.GetEncoder(437))
Dim content As String
content = TextToHtmlEntity(file.ReadToEnd)
file.Close()

'content now contains a string of HTML entities
End Sub

Private Function TextToHtmlEntity(ByVal text As String) As String
Dim textVal As Integer
Dim encoded As String = ""
Dim c As Char

For Each c In text
textVal = AscW(c)
If textVal >= 49 And textVal <= 122 Then
encoded += c
Else
encoded += String.Concat("&#",
textVal.ToString(System.Globalization.NumberFormatInfo.InvariantInfo), ";")
End If
Next

Return encoded
End Function
[/CODE]

1

You can use the MouseMove event and check if the mouse pointer is within the Bounds of the stripmenu item.
If that's the case, simply change the BackgroundColor.
[CODE]
Private Sub menuitem1_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs)
If menuitem1.Bounds.Contains(e.Location) Then
menuitem1.BackColor = Color.Beige
Else
menuitem1.BackColor = Color.White
End If
End Sub
[/CODE]

Comments
Thank you.
1

I'm using a single method for resizing images in both directions.
It returns a BitMap object that you can use on wherever you like.

[CODE]
public BitMap ResizeBitMap(BitMap source, Size newSize)
{
//Get the source bitmap
BitMap bm_source = source;

//Create a bitmap for the result
BitMap bm_dest = new BitMap(newSize.Width, newSize.Height);

//Create a Graphics object for the resulting BitMap
Graphics gr_dest = Graphics.FromImage(bm_dest);

//Copy the source image into the destination bitmap
gr_dest.DrawImage(bm_source, 0, 0, bm_dest.Width + 1, bm_dest.Height + 1);

//Return the result
return bm_dest;
}
[/CODE]

Here is one way of how you can use it:
[CODE]
private void someMethod()
{
BitMap resizedImage = ResizeBitMap(loadedImage, new Size(loadedImage.Width .9, loadedImage.Height .9));

//Stick that resized bitmap anywhere you like it.
//For example a PictureBox
pictureBox1.Image = resizedImage;
}
[/CODE]

1

Do you remember the connection string I gave you in your previous post "Need Help"?
Try using that one instead.

If I recall correctly, the constant DATA_SOURCE already contains "data source=JAKE-PC\SQLEXPRESS", so what you have done in your StingBuilder is declare the data source twice.
It's redundant, and causes errors.

And, the format of your connection string is targeted towards MSSQL 2005/2008.
Try using "Integrated Security=SSPI" instead of "trusted_connection=yes;".

1

If you wanna move or copy files from one location to another using your program, there are easier ways than using FileStream.

[CODE]
Imports System.IO

Private Sub FileCopy()
    Dim strFileSource As String = "C:\Temp\sourceFile.txt"
    Dim strFileDestination As String = "C:\Temp\destinationFile.txt"

    File.Copy(strFileSource, strFileDestination)
End Sub

Private Sub FileMove()
    Dim strFileSource As String = "C:\Temp\sourceFile.txt"
    Dim strFileDestination As String = "C:\Temp\destinationFile.txt"

    File.Move(strFileSource, strFileDestination)
End Sub

Private Sub CopyMoveMultipleFiles()
    Dim strSourceDirectory As String = "C:\Temp"
    Dim strDestinationDirectory As String = "C:\SecondaryTemp"
    Dim di As New DirectoryInfo(strSourceDirectory)

    'To copy files
    For Each fi As FileInfo In di.GetFiles
        fi.CopyTo(strDestinationDirectory & "\" & fi.Name)
    Next

    'To move files
    For Each fi As FileInfo In di.GetFiles
        fi.MoveTo(strDestinationDirectory & "\" & fi.Name)
    Next
End Sub

[/CODE]

1

You should consider moving that code onto a button click event.
Otherwise the query will be fired for every keystroke you use in the textbox.

And you are very close to the solution, my friend. :)
Notice my lack of use of the SqlConnection object. It will work anyway, because the SqlDataAdapter will take care of connecting to the database. If provided with the connection string.

The SqlCommandBuilder will help take care of creating INSERT, UPDATE and DELETE statements for you.
[CODE]
Private bindingSource1 As New BindingSource

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
AuthorsGridView.DataSource = bindingSource1
End Sub

Private Sub TextBoxId_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBoxIdSearchExist.TextChanged
Try
da = New SqlDataAdapter("SELECT * FROM pay WHERE t_id = '" & tId.Text & "'", <your connection string>)
Dim builder As New SqlCommandBuilder(da)
da.Fill(ds, "pay") 'Needs to be the name of the source table

  'I don't know what GetData(queryString) is for, so I'm ignoring it
  If ds.Tables.Count > 0 Then
     bindingSource1.DataSource = ds.Tables(0)
  Else
     MessageBox.Show("No results found in database.")
  End If

Catch ex As Exception
MessageBox.Show("Unable to connect to database, or an error occured.")
End Try
End Sub
[/CODE]

Comments
Nice !!
1

You could use the method GetProcessesByName in order to determine if a certain process is running.
It returns an array of processes containing all instances of a certain named process, for example "wmplayer".
If the Length of the array is greater than 0, then that particular process is running.
This snippet also eliminates the need for ListBoxes and things like that.
[CODE]
If GetProcesses("wmplayer") > 0 Then
textbox.Text = textbox.Text & Environment.NewLine & " -> Windows Media Player"
End If

Private Function GetProcesses(nameOfProcess As String) As Integer
Dim namedProcess As Process() = Process.GetProcessesByName(nameOfProcess)
Return namedProcess.Length
End Function
[/CODE]

1

In addition to adding the reference to Microsoft Outlook 14, make sure that you also import the namespace Microsoft.Office.Interop.

Then you can use this code to create a mail message.
[CODE]
Dim oApp As New Outlook.Application()
Dim oMsg As Outlook.MailItem

oMsg = oApp.CreateItem(Outlook.OlItemType.olMailItem)
oMsg.To = "reciever@domain.com"
oMsg.Subject = "mail subject"
oMsg.Body = "simple mail body text"
'' OR
'oMsg.HTMLBody = "html mail body text"

oMsg.Send()

'Optionally also use:
'oMsg.Display()
[/CODE]

Comments
agree
1

Yes, I would revise that code into something like this.
[CODE]
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim playerdrivers As New ArrayList
Dim destination As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\f1data\bin\array.txt"
Dim FileReader1 As New StreamReader(destination)
Dim Contents1 As String
Dim index As Integer = 0

While FileReader1.Peek <> -1
Contents1 = FileReader1.ReadLine
Dim array As New ArrayList
array.AddRange(Contents1.Split(","))
playerdrivers.Add(array)
End While

FileReader1.Close()
[/CODE]
After that you can easily access each player and driver using [B]almost[/B] the same method as you intended:
playerdrivers(0).Item(0) - playerdrivers(0).Item(5)
playerdrivers(1).Item(0) - playerdrivers(1).Item(5)

Comments
Very helpful.