lostwages702
New member
- Joined
- Nov 1, 2010
- Messages
- 3
- Programming Experience
- 3-5
I have run into what I am thinking will be a simple solution, but I am just overlooking it. Below is a snippet from my program, which everything is working fine, it is just the syntax of this portion that I am having a slight issue with and I am hoping someone may be able to assist.
Here is a breakdown of the code below, if MyType.Type equals any of the types I have listed, then it will add a bold header (SectHedr), then it will add the lines with the type counts and other text. The only issue, is that it is adding the header before each line with the counts, but in reality, I need it to only add the header once, and then the lines with the counts like so:
General Features
Total lines found: 10
Total arcs found: 15
And this is what I am really getting:
General Features
Total lines found: 10
General Features
Total arcs found: 15
General Features
Total circles found: 1
I hope this makes sense and that someone can give me an idea as to how to fix it give me the desired outcome. Thanks in advance.
Here is a breakdown of the code below, if MyType.Type equals any of the types I have listed, then it will add a bold header (SectHedr), then it will add the lines with the type counts and other text. The only issue, is that it is adding the header before each line with the counts, but in reality, I need it to only add the header once, and then the lines with the counts like so:
General Features
Total lines found: 10
Total arcs found: 15
And this is what I am really getting:
General Features
Total lines found: 10
General Features
Total arcs found: 15
General Features
Total circles found: 1
VB.NET:
If MyType.Type.ToString.Equals("LINE") OrElse MyType.Type.ToString.Equals("ARC") OrElse _
MyType.Type.ToString.Equals("CIRCLE") = True Then
Dim SectHedr As String = "General Features"
AppendBoldHdrTxt(RichTextBox1, SectHedr)
RichTextBox1.AppendText(vbLf)
If MyType.Type.ToString = "LINE" Then
RichTextBox1.AppendText("Total lines found: " & AcObjCntr.ToString & vbLf)
ElseIf MyType.Type.ToString = "ARC" Then
RichTextBox1.AppendText("Total arcs found: " & AcObjCntr.ToString & vbLf)
ElseIf MyType.Type.ToString = "CIRCLE" Then
RichTextBox1.AppendText("Total circles found: " & AcObjCntr.ToString & vbLf)
End If
End If
I hope this makes sense and that someone can give me an idea as to how to fix it give me the desired outcome. Thanks in advance.