Minimalist 96 Posting Pro

You find the progress control in the toolbox under common controls. Also you might want to check this link out:
http://www.tutorialspoint.com/vb.net/vb.net_progress_bar.htm
Your other post was probably deleted because you posted it twice.

Minimalist 96 Posting Pro

Sorry, my first reply was more for vb6. Thsi should work in vb.net

For Each frm As Form in Me.MdiChildren
  MessageBox.Show(frm.Name)
Next
Minimalist 96 Posting Pro

O.K. this is the code to check for open child forms and to do something when there are open forms

Dim F As Form
For Each F In Forms
    If F.MDIChild Then
        ' It's a loaded MDIChild form
    End If
Next F
Minimalist 96 Posting Pro
Dim txtString as String
txtString=Trim(textbox1.Text)

This will work only if you have not created a textbox array. The best is to show us the code you use to create your textboxes to receive sensible help

Minimalist 96 Posting Pro

There a few things you can check in vb6 code. Do a serch on google:
check hard disk with vb6
and check this one out:
http://msdn.microsoft.com/en-us/library/vstudio/xw6hsa4x(v=vs.100).aspx
Do a search of search on any hardware check vou want to perform on google

Minimalist 96 Posting Pro

Excellent stuff there!!

Minimalist 96 Posting Pro

You can close a child form by using:

 Me.ActiveMdiChild().Close()
Minimalist 96 Posting Pro

So tell me what was wrong

Minimalist 96 Posting Pro

Switch all the sorting in your listboxes off. Line 8 will not work like this. It is like I showed you or you have to use:
If Not Len(Trim(entry)) = 0 Then LstData3.AddItem temp

Minimalist 96 Posting Pro

can you open your database with ms access and make sure you got the data in there you want?

Minimalist 96 Posting Pro

If dim temp as string doesn't work you are returning not a string from your database? Check the properties of the column eftn in the database. Also maybe try this and check what error msg you get:

If Not Len(Trim(entry)) = 0 Then
LstData3.AddItem entry & temp
List1E.AddItem temp
end if
Minimalist 96 Posting Pro

I don't understand what you mean by rs("eftn") is function

Minimalist 96 Posting Pro

So what sort of data is contained in rs("eftn")?
and does your program now as you want it to?

Minimalist 96 Posting Pro

Maybe replace line 14 with:
if rs("eftn") <> "" then
temp= rs("eftn")
else
temp="---"
end if

Minimalist 96 Posting Pro

You have to find out why it stopped at line 14 - is there any data in rs("eftn")

Minimalist 96 Posting Pro

Now in regards to your sorting, obviously you only can sort by one listbox at the time. So you add the first item to the listbox you want your data sorted by. You get the index of where the item is added and than you insrt the items in the other listboxes at this index.

Minimalist 96 Posting Pro

O.K. let' assume you got all the correct data. You now have to look at the data you add. If temp is empty, what you do than?
You add data to the first listbox, but nothing to the second. So if the next data comes along you add it to the first listbox at an index that will be different from the index in the second listbox. So if temp=" " then add something like Temp= "----", that will avoid the distortion of added entries.

Minimalist 96 Posting Pro

O.K. let's take it bit by bit. First check that the loop works and returns the correct entries. Rem everything out but the stuff that returns the strings. Dimension the strings correctly and we check that the counter works. Print everything to debug.

Dim icounter As Integer
    Dim entry as String
    Dim temp as String
    iCounter=0
    'Check if the recordset contain records'
    If Not rs.RecordCount = 0 Then
    'Move to the first record'
    rs.MoveFirst
    'Loop till the recordset return EOF(end of file)'
    While Not rs.EOF
    ' For i = 1 To max
entry = rs("email")
Debug.print(entry)
temp = rs("eftn")
Debug.print(temp)
'If Not Len(Trim(entry)) = 0 Then LstData3.AddItem entry & temp
'If Not Len(Trim(entry)) = 0 Then List1E.AddItem temp
'If Not Len(Trim(rs("email"))) = 0 Then List2e.AddItem rs("namn")
    'do some stuff here'
     icounter = icounter + 1
     Debug.print(iCounter)
    'Move to the next record'
    rs.MoveNext

    Wend
    End If
Minimalist 96 Posting Pro

Happy New Year to You too.

From what I see you use trhe i as a counter but set it up like a loop.
Just dim it outside your record retrieval and than add 1 to it :

dim icounter as Integer
'Check if the recordset contain records'
If Not rs.RecordCount=0 Then
'Move to the first record'
   rs.MoveFirst
'Loop till the recordset return EOF(end of file)'
   While Not rs.EOF
     'do some stuff here'
'Move to the next record'
      rs.MoveNext
      iCounter = iCounter + 1
   Wend
End If

Also check this one out:
http://visualbasic.freetutes.com/learn-vb6/lesson4.html

Minimalist 96 Posting Pro

Well looking at the second picture I can see thet you are not retrieving the data correctly or it is strored incorrectly.

Minimalist 96 Posting Pro

O.K. I start again. From your few lines of text nobody can help you. Have a look at the many other post to get a picture of someone needs to help you. Where do you store the data? How do you get it there? Hoe do you want to publish it-Crystal Reports, text file, vb6 reportbuider? How much code have got to show?
No one will code the application for you, but you will get help trying hard.

Minimalist 96 Posting Pro

Is there a question

Minimalist 96 Posting Pro

We need to see your printing code.

Minimalist 96 Posting Pro

OK, did you check the data you are returning? You can use something like debug.print("Your Data") to see what your loop is returning. Nake sure the data is stored correctly in your database - open it with access and have a look. I will check later that you use the correct code - from memory there is something like an index, like LstData3.AddItem rs("Email1",0) - check it and I will get back.

Minimalist 96 Posting Pro

If you get the samedata in each listbox you need to check how you retrieve the data. Where is your data stored in?

Minimalist 96 Posting Pro

OK, but I can just see one listbox in your code. So I just give you a rough idea:
Your existing code:

If Not Len(Trim(rs("Email1"))) = 0 Then LstData3.AddItem rs("Email1") & " " & rs("eftn") & " " & rs("namn")

Ok, now lets assume you have 3 listboxes, LstData4,LstData5
then you want to clear these so the index starts at 0
and you would do something like:

If Not Len(Trim(rs("Email1"))) = 0 Then
LstData3.AddItem rs("Email1")
LStData4. AddItem rs("eftn")
LstData5.AddItem rs("namn")
end if

Minimalist 96 Posting Pro

The trick now is to keep your listboxes synchronised via the index properties of the listboxes. Clear the listboxes, add the email to the first one get the index where you added and add the next bit of info into the second one at the same index from the first listbox. If you remove an item in the first one you need to get the index and remove the same index in the second listbox, this way you synchrinse the listboxes.

Minimalist 96 Posting Pro

There are a number of different time formats you can use- depends what you want. Off Dream in Code
http://www.dreamincode.net/forums/topic/337172-display-date-in-words/

Dim today = DateTime.Now
'Display time in different labels and different formats

Label1.Text = String.Format("{0:dddd, MMMM d}", today)

Label2.Text = String.Format("{0:hh:mm tt}", today)

Also check this out for different time formats:
http://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1

Minimalist 96 Posting Pro

Net Framework 4 CLR20r3 Error
http://social.msdn.microsoft.com/Forums/vstudio/en-US/a7ed93ad-2923-48c4-9e51-cf0bd6d4e100/net-framework-4-clr20r3-error?forum=netfxsetup
From what I have been reading it could be that you compiled your program to a higher Famework version then what is installed on your friends computer.

Minimalist 96 Posting Pro

You are already using the Len() method. So you need to dim an integer like dim intLen and than assign it the Len of your email
like: intLen= Len(Trim(rs("Email1"))). Alternatively you can count the characters in a string.

Minimalist 96 Posting Pro

I've created all the forms I need for it work but I cant create the main form that the user will use to choose what action will be executed,

Click on MyProject which opens a new tab and there you can set the startup form that will be displayed when your program is started.

Minimalist 96 Posting Pro
Minimalist 96 Posting Pro

Printerlist is shows the printers installed on your system. So have to make sure that a printer is istalled, select the printer and print to it. I see if I can find the full code again and post it here later,

Minimalist 96 Posting Pro
' Visual Basic 6.0
For i = 1 To ListView1.ListItems.Count
    If ListView1.ListItems(i).Selected = True Then
        MsgBox(ListView1.SelectedItem
    End If
Next i

Also check out this reference:
http://msdn.microsoft.com/en-us/library/ms172636(v=vs.90).aspx

Minimalist 96 Posting Pro

This comes off a code snippet in this forum

Private Sub cmdPrint_Click()
  'set the printer and print something
  If Len(PrinterList.SelectedItem.Text) > 0 Then
    Set Printer = Printers(PrinterList.SelectedItem.Index - 1)
    Printer.Copies = NoCopies
  End If
  'add any print statements here that you want
  Printer.Print "hello"
  Printer.EndDoc
  cmdCancel_Click
End Su
Minimalist 96 Posting Pro

O.K lets start again VB6

Private Sub Form_Load()
Player(0) = "PLayer1"
Player(1) = "PLayer2"
Player(2) = "PLayer3"
End Sub

Private Sub Player_Change(Index As Integer)
Call chekIT
End Sub

Private Sub chekIT()
Dim I As Integer
Dim PlayX As Integer
Dim num As Integer
num = 1
For PlayX = 0 To 2

    If Player(PlayX) = "YT" Then
        'Put other code bits in here
        MsgBox ("YT")
        Player(PlayX).AddItem ("Games Played" & " " & num)
    End If

    If Player(PlayX) = "Morbid" Then
        MsgBox (Player(PlayX))
    End If

    If Player(PlayX) = "Big Head" Then
        MsgBox (Player(PlayX))
    End If
Next
End Sub

.I have created an array of three comboboxes, indexes 0,1,2. I have loaded player1,2,3 in the form load event. I have created a sub checkIT that does the work and will be called each time the text in one of the comboboxes changes. There need to be error code added to not load stuff more than once into the comboboxes!
Now I can't see how you assign your strings to form text that you save or variables declared to read your text back in.
However, try this code and modify it.

Minimalist 96 Posting Pro

There isno easy way or no way to change the forecolor of a command button. Workaround is easy. Instead of using a command button use a checkbox. This has the same properties as a command button but also a forecolor property.
What you do is set the property style to graphical. The checkbox looks like command button after and you can set the forecolor

Check1.ForeColor = vbRed
Minimalist 96 Posting Pro

Not knowing which version of vb you are using I do use vb6 for this.
Your loop is ok but you are not accessing the combos. You either have created and array of these or added these one by one. If the last is the case you need to set the index property to 1 to 10.
Here is a bit of code that demonstrates this:

Private Sub Form_Load()
Dim I As Integer
I = Player1(1).Index
MsgBox (I)
If Player1(1).Index = 1 Then
Player1(1).Text = "Hello"
End If
End Sub

Obviously you would have to replace my (1) with your (PlayX) of sort

Minimalist 96 Posting Pro
Minimalist 96 Posting Pro

get rid of me.close because it exits your application

Minimalist 96 Posting Pro

Maybe If TextBox2.Text = "qwerty" Then

Minimalist 96 Posting Pro

In Textbox2.text you have "Password Then" maybe it should only be "Password" , jsut guessing

Minimalist 96 Posting Pro

I am using vb express 13 and office 7.
I have a form and one button to open Excel and populate some cells.
The following code I have modified some and shortenend, but it works fine.

Imports Microsoft.Office.Core
Imports Microsoft.Office.Interop


Public Class Form1

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

        Dim oXL As Application
        Dim oWB As Microsoft.Office.Interop.Excel.Workbook
        Dim oSheet As Excel.Worksheet
        Dim oRng As Excel.Range

        ' Start Excel and get Application object.

        Dim xlApp As New Microsoft.Office.Interop.Excel.Application

        xlApp.Visible = True

        ' Get a new workbook.
        oWB = xlApp.Workbooks.Add
        oSheet = oWB.ActiveSheet

        ' Add table headers going cell by cell.
        oSheet.Cells(1, 1).Value = "First Name"
        oSheet.Cells(1, 2).Value = "Last Name"
        oSheet.Cells(1, 3).Value = "Full Name"
        oSheet.Cells(1, 4).Value = "Salary"

        ' Format A1:D1 as bold, vertical alignment = center.
        With oSheet.Range("A1", "D1")
            .Font.Bold = True
            .VerticalAlignment = Excel.XlVAlign.xlVAlignCenter
        End With

        ' Create an array to set multiple values at once.
        Dim saNames(5, 2) As String
        saNames(0, 0) = "John"
        saNames(0, 1) = "Smith"
        saNames(1, 0) = "Tom"
        saNames(1, 1) = "Brown"
        saNames(2, 0) = "Sue"
        saNames(2, 1) = "Thomas"
        saNames(3, 0) = "Jane"

        saNames(3, 1) = "Jones"
        saNames(4, 0) = "Adam"
        saNames(4, 1) = "Johnson"

        ' Fill A2:B6 with an array of values (First and Last Names).
        oSheet.Range("A2", "B6").Value = saNames

        ' Fill C2:C6 with a relative formula (=A2 & " " & B2).
        oRng = oSheet.Range("C2", "C6")
        oRng.Formula = "=A2 & "" "" & B2"

        ' Fill D2:D6 with a formula(=RAND()*100000) and apply format. …
Minimalist 96 Posting Pro

No it doesn't mean this. If you create the controls during design time you can use the tag property or maybe the name of the control. If you create them during runtime you can create control arrays. If you put them into a container you can access them with something like this:

Private Sub ClearAll()
        For Each ctrl As Control In Me.Controls
            If ctrl.[GetType]().Name = "Panel" Then
                ClearControls(ctrl)
            End If

            If ctrl.[GetType]().Name = "GroupBox" Then
                ClearControls(ctrl)
            End If
            If ctrl.[GetType]().Name = "ComboBox" Then
                Dim tb As ComboBox = TryCast(ctrl, ComboBox)
                tb.SelectedText = ""
            End If
        next

This works for the inner controls. see this discussion
http://stackoverflow.com/questions/199521/vb-net-iterating-through-controls-in-a-container-object
Also there are a few discussions on this website ------------> just
beside this reply plus there are some others open that also show how to acces the controls. Hope this helps.

Minimalist 96 Posting Pro

I just checked out this example and it is excellent
"adding multiple TextBoxes to a form (control array)"

Minimalist 96 Posting Pro

Bilaluddin I have used your new code. I do get a misalignment if the form is too small and I need to enlarge it. On a maximised form I do net get any issues with the alignment. Have a look at some related issues in this forum.
I also put another button on to remove all the controls and redraw them.

 Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        For i As Integer = Me.Controls.Count - 1 To 0 Step -1
            If TypeOf Me.Controls(i) Is TextBox Then
                Me.Controls.RemoveAt(i)
            End If
        Next
        For k As Integer = Me.Controls.Count - 1 To 0 Step -1
            If TypeOf Me.Controls(k) Is Label Then
                Me.Controls.RemoveAt(k)
            End If
        Next
    End Sub

This will allow you to redraw the controls at diffrent form sizes-

Minimalist 96 Posting Pro

O.K. the irst thing I would do is to make a list of what you want to achieve in each step. Once you have done this I would create small test programs and investigate each control to find out that it does what you want it to do. Instead of overlaying controls you can use for example the label or button to load different pictures in which you create in a paint program. Good luck

Minimalist 96 Posting Pro

Just double click on "Sub sub menu 3.3" and add something like this:

Private Sub LoadForm2ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles LoadForm2ToolStripMenuItem.Click
        Form2.Show()
    End Sub

also check this link out:
http://www.tutorialspoint.com/vb.net/vb.net_menustrip.htm

Minimalist 96 Posting Pro

Just tried your code. Just removed
'AddHandler newbox.TextChanged, AddressOf TextBox_TextChanged
because it threw an error. Textboxes line up ok. 23837161e29387458df840de5d1411e4

Minimalist 96 Posting Pro

'SQL Connection String
sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\yourdatabase.mdb"