none
DISPLAYING A RRS feed

Answers

  • No offense but from your comments I doubt you can do this project. You should pick something you have a chance of doing and learning on your own.

    :)

    Imports System.Drawing.Drawing2D
    
    Public Class Form3
        Private WithEvents timer1 As New System.Windows.Forms.Timer With {.Interval = 200, .Enabled = False}
        Private WithEvents button1 As New Button With {.Parent = Me, .Location = New Point(150, 200), .Text = "go"}
        Private _A() As PointF = {New PointF(2, 0), New PointF(5, 10),
                New PointF(5, 10), New PointF(8, 0),
                New PointF(3, 4), New PointF(7, 4)}
        Dim section As Integer
        Dim lastx, lasty, dx, dy As Single
    
        Private Sub Form3_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
            Dim scale As Single = 20
            Dim r As Single = CSng(ClientSize.Height / scale)
    
            With e.Graphics
                .Clear(Color.Black)
                .SmoothingMode = SmoothingMode.AntiAlias
                .ScaleTransform(r, -r)
                .TranslateTransform(CSng(0.33 * scale), CSng(-0.67 * scale))
    
                Using p As Pen = New Pen(Color.SkyBlue, 0.4),
                        p2 As Pen = New Pen(Color.Red, 0.5)
    
                    'draw the letter
                    For i As Integer = 0 To _A.Count - 1 Step 2
                        .DrawLine(p, _A(i).X, _A(i).Y, _A(i + 1).X, _A(i + 1).Y)
                    Next
    
                    'draw the arrow
                    If lastx > 0 Then
                        DrawArrow(e.Graphics, p2, 1, lastx, lasty, _A(section + 1).X, _A(section + 1).Y)
                    End If
    
                End Using
            End With
        End Sub
    
        Private Sub DrawArrow(g As Graphics, p As Pen, l As Single, x1 As Single, y1 As Single, x2 As Single, y2 As Single)
            Dim angle As Single = CSng(Math.Atan2(y1 - y2, x1 - x2) * 57.3)
            Dim rect As RectangleF = New RectangleF(lastx - (l / 2), lasty - (l / 2), l, l)
            g.DrawPie(p, rect, angle - 25, 50)
        End Sub
    
        Private Sub timer1_Tick(sender As Object, e As EventArgs) Handles timer1.Tick
    
            If section = 0 And dx = 0 Then
                lastx = _A(section).X
                lasty = _A(section).Y
            End If
    
            If dx = 0 Then
                dx = (_A(section + 1).X - _A(section).X) / 10
                dy = (_A(section + 1).Y - _A(section).Y) / 10
            End If
    
            lastx += dx
            lasty += dy
    
            If lastx > _A(section + 1).X Then
    
                section += 2
                dx = 0
    
                If section > _A.Count - 1 Then
                    timer1.Stop()
                    section = 0
                    lastx = 0
                Else
                    lastx = _A(section).X
                    lasty = _A(section).Y
                End If
            End If
    
            Invalidate()
    
        End Sub
    
        Private Sub button1_Click(sender As Object, e As EventArgs) Handles button1.Click
            timer1.Start()
        End Sub
    
        Private Sub Form3_Load(sender As Object, e As EventArgs) Handles Me.Load
            DoubleBuffered = True
        End Sub
    End Class

    • Marked as answer by SKG123 Thursday, March 22, 2018 5:06 PM
    • Unmarked as answer by SKG123 Thursday, March 22, 2018 5:06 PM
    • Marked as answer by SKG123 Thursday, March 22, 2018 5:06 PM
    Thursday, March 22, 2018 2:43 PM

All replies

  • Hi,

    To help you better, you need to provide as many details as you can about the problem.

    Do you want to move pointer onto a control such as TextBox by your code?If so, write code like this:
    TextBox1.Select()
    Regards,

    Ashidacchi >> http://hokusosha.com/

    Wednesday, March 21, 2018 5:37 AM
  • No actually i want to display pointer moving on letter A in animated manner 
    Wednesday, March 21, 2018 6:46 AM
  • No actually i want to display pointer moving on letter A in animated manner 

    Do you mean that you want to position the blinking caret at the letter 'A' in some text?
    https://msdn.microsoft.com/en-us/library/windows/desktop/ms646968(v=vs.85).aspx

    • Proposed as answer by Cor Ligthert Wednesday, March 21, 2018 8:09 AM
    Wednesday, March 21, 2018 7:45 AM
  • Hi SKG123,

    Does "pointer moving on letter A" mean the same as Acamar mentions? 
    So, what does it mean by "in animated manner"?

    I'm afraid you need to explain more concrete details. 

    Regards,

    Ashidacchi >> http://hokusosha.com/

    Wednesday, March 21, 2018 8:14 AM
  • If you actually mean the mouse pointer then that would be most difficult. Nor do you mention where the letters are located, in a TextBox, Label, RichTextBox, etc.

    As the Font, Font size and Font style would all have to do with moving the mouse pointer correctly. Also if the mouse were manually moved the mouse pointer would move along with the mouse while the app was trying to place the mouse pointer somewhere else which would be ugly.

    Perhaps instead you may use GDI+ to draw a cursor or something where you want it to appear. Either way it would not be a simpleton task really.


    La vida loca

    Wednesday, March 21, 2018 1:38 PM
  • Wednesday, March 21, 2018 2:51 PM
  • Hi SKG123,

    Are you making an educational software that teaches children how to write alphabet, especially stroke order?

    Regards,

    Ashidacchi >> http://hokusosha.com/

    Wednesday, March 21, 2018 9:44 PM

  • That looks like an image to me. If you use GDI+ to draw the letter A then you can use GDI+ to also draw a pointer to move along the lines you draw. However that would be drawing by drawing lines and ellipses for characters so that you know the points to use to get for moving the arrow. And not using GDI+ to specificially draw TEXT. So it would be simpler but still time consuming to write. And all you post is a simple question and a simple image. You do not provide enough detail on exactly what you are trying to do so I would have to guess and I don't want to waste alot of time guessing what you actually want and writing and re-writing code until what you desire has been met.

    La vida loca

    Thursday, March 22, 2018 1:31 AM
  • Thursday, March 22, 2018 3:26 AM
  • EVEN IF  I CAN SHOW ARROW KEY MOVING ON LETTER A IT WOULD BE OK
    Thursday, March 22, 2018 3:49 AM
  • YES YOU ARE RIGHT

    CAN U PLEASE HELP ME IN THIS PROJECT

    Thursday, March 22, 2018 3:51 AM
  • actually i m working on a project i.e to teach children how to write ABCD.There  are three levels in my game .In my first level i have to show to chilren that how ABCD is writtten in a proper manner thats why i m trying to make arrow on letters.In the second label by seeing the arrow they will try to overwite on letter ABCD. As we use to do during our childhood but this things will be done in seperate box where letter ABCD is written but without arrow.In the third level nothing is written inside box and they will write ABCD and here scores will be given to them 
    Thursday, March 22, 2018 4:02 AM
  • Hi SKG123,

    Yes, I want to help you. But I'm afraid language barrier would exist between us and that it would be hard to explain software specification to others.

    I'm a software developer self-employed (live in Japan), and recognize well the hardness of specifying software specification.  
    Do you have some documents of your software? If yes, please provide it (a part of it, is OK)

    Regards,

    Ashidacchi >> http://hokusosha.com/

    • Edited by Ashidacchi Thursday, March 22, 2018 4:31 AM
    Thursday, March 22, 2018 4:28 AM
  • Hi

    As a possible alternative, consider this. This is a stand alone example project.

    The aim here would be to 'trace' the letter inside the character outline rather than the 'arrow' method you mention.

    The Font and size can be adjusted to suit.

    The character can be selected from the ComboBox (indeed, any string or set of characters could be shown - i.e. full words)

    This is just an example and is not embellished in any way.

    If you want to try it, you will need a default ComboBox1 on Form1.

    Option Strict On
    Option Explicit On
    Imports System.Drawing.Drawing2D
    Public Class Form1
      Dim path As New GraphicsPath
      Dim letters As New List(Of String)
      Dim currentletter As String
      Dim myPen As New Pen(Color.Black, 2)
    
      ' configure font and position here
      Dim pos As New Point(80, 0)
      Dim fnt As New Font("Consolas", 96, FontStyle.Bold)
      Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    	For i As Integer = 65 To 90
    	  letters.Add(ChrW(i))
    	Next
    	ComboBox1.DataSource = letters
    	ComboBox1.SelectedIndex = 0
      End Sub
      Private Sub Form1_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
    	path.AddString(currentletter, fnt.FontFamily, fnt.Style, fnt.SizeInPoints, pos, StringFormat.GenericDefault)
    	e.Graphics.DrawPath(myPen, path)
    	path.Reset()
      End Sub
      Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
    	currentletter = ComboBox1.SelectedItem.ToString
    	Invalidate()
      End Sub
    End Class


    Regards Les, Livingston, Scotland


    • Edited by leshay Thursday, March 22, 2018 5:25 AM
    Thursday, March 22, 2018 5:24 AM
  • using System;
    public class Exercise58
    {
        public static void Main()
        {
            Console.BackgroundColor = ConsoleColor.White;
            Console.Clear();
            Console.ForegroundColor = ConsoleColor.DarkRed;
            int row, column;
           
    
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'A' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 7; row++)
            {
                for (column = 0; column <= 7; column++)
                {
                    if (((column == 1 || column == 5) && row != 0) ||
                         ((row == 0 || row == 3) && (column > 1 && column < 5)))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
    
            Console.ReadLine();
            Console.Clear();
    
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'B' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if (column == 1 || ((row == 0 || row == 3 || row == 6) && (column < 5 && column > 1)) || (column == 5 && (row != 0 && row != 3 && row != 6)))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
    
            Console.ReadLine();
            Console.Clear();
    
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'C' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if ((column == 1 && (row != 0 && row != 6)) || ((row == 0 || row == 6) && (column > 1 && column < 5)) || (column == 5 && (row == 1 || row == 5)))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
    
    
            Console.ReadLine();
            Console.Clear();
    
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'D' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if (column == 1 || ((row == 0 || row == 6) && (column > 1 && column < 5)) || (column == 5 && row != 0 && row != 6))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
            Console.ReadLine();
            Console.Clear();
    
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'E' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if (column == 1 || ((row == 0 || row == 6) && (column > 1 && column < 6)) || (row == 3 && column > 1 && column < 5))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
    
            Console.ReadLine();
            Console.Clear();
    
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'F' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if (column == 1 || (row == 0 && column > 1 && column < 6) || (row == 3 && column > 1 && column < 5))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
    
    
            Console.ReadLine();
            Console.Clear();
    
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'G' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if ((column == 1 && row != 0 && row != 6) || ((row == 0 || row == 6) && column > 1 && column < 5) || (row == 3 && column > 2 && column < 6) || (column == 5 && row != 0 && row != 2 && row != 6))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
    
    
            Console.ReadLine();
            Console.Clear();
    
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'H' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if ((column == 1 || column == 5) || (row == 3 && column > 1 && column < 6))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
    
    
            Console.ReadLine();
            Console.Clear();
    
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'I' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if (column == 3 || (row == 0 && column > 0 && column < 6) || (row == 6 && column > 0 && column < 6))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
    
    
            Console.ReadLine();
            Console.Clear();
    
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'J' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if ((column == 4 && row != 6) || (row == 0 && column > 2 && column < 6) || (row == 6 && column == 3) || (row == 5 && column == 2))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
    
            Console.ReadLine();
            Console.Clear();
            int i;
            int j;
             j = 5;
             i = 0;
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'K' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if (column == 1 || ((row == column + 1) && column != 0))
                        Console.Write("*");
    
                    else if (row == i && column == j)
                    {
                        Console.Write("*");
                        i = i + 1;
                        j = j - 1;
                    }
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
    
    
            Console.ReadLine();
            Console.Clear();
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'L' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if (column == 1 || (row == 6 && column != 0 && column < 6))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
    
    
            Console.ReadLine();
            Console.Clear();
    
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'M' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if (column == 1 || column == 5 || (row == 2 && (column == 2 || column == 4)) || (row == 3 && column == 3))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
    
            Console.ReadLine();
            Console.Clear();
    
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'N' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if (column == 1 || column == 5 || (row == column && column != 0 && column != 6))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
    
            Console.ReadLine();
            Console.Clear();
    
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'O' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if (((column == 1 || column == 5) && row != 0 && row != 6) || ((row == 0 || row == 6) && column > 1 && column < 5))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
    
    
            Console.ReadLine();
            Console.Clear();
    
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'P' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if (column == 1 || ((row == 0 || row == 3) && column > 0 && column < 5) || ((column == 5 || column == 1) && (row == 1 || row == 2)))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
    
    
            Console.ReadLine();
            Console.Clear();
    
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'Q' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if ((column == 1 && row != 0 && row != 6) || (row == 0 && column > 1 && column < 5) || (column == 5 && row != 0 && row != 5) || (row == 6 && column > 1 && column < 4) || (column == row - 1 && row > 3))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
    
    
            Console.ReadLine();
            Console.Clear();
    
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'R' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if (column == 1 || ((row == 0 || row == 3) && column > 1 && column < 5) || (column == 5 && row != 0 && row < 3) || (column == row - 1 && row > 2))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
    
    
            Console.ReadLine();
            Console.Clear();
    
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'S' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if (((row == 0 || row == 3 || row == 6) && column > 1 && column < 5) || (column == 1 && (row == 1 || row == 2 || row == 6)) || (column == 5 && (row == 0 || row == 4 || row == 5)))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
    
    
            Console.ReadLine();
            Console.Clear();
    
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'T' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if (column == 3 || (row == 0 && column > 0 && column < 6))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
    
    
            Console.ReadLine();
            Console.Clear();
    
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'U' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if (((column == 1 || column == 5) && row != 6) || (row == 6 && column > 1 && column < 5))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
    
            Console.ReadLine();
            Console.Clear();
    
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'V' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if (((column == 1 || column == 5) && row < 5) || (row == 6 && column == 3) || (row == 5 && (column == 2 || column == 4)))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
    
    
            Console.ReadLine();
            Console.Clear();
    
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'W' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if (((column == 1 || column == 5) && row < 6) || ((row == 5 || row == 4) && column == 3) || (row == 6 && (column == 2 || column == 4)))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
    
    
            Console.ReadLine();
            Console.Clear();
    
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'X' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if (((column == 1 || column == 5) && (row > 4 || row < 2)) || row == column && column > 0 && column < 6 || (column == 2 && row == 4) || (column == 4 && row == 2))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
    
    
            Console.ReadLine();
            Console.Clear();
    
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'Y' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if (((column == 1 || column == 5) && row < 2) || row == column && column > 0 && column < 4 || (column == 4 && row == 2) || ((column == 3) && row > 3))
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
    
    
            Console.ReadLine();
            Console.Clear();
    
            Console.Write("\n\n");
            Console.Write("Display the pattern like 'Z' with an asterisk:\n");
            Console.Write("---------------------------------------------");
            Console.Write("\n\n");
    
            for (row = 0; row <= 6; row++)
            {
                for (column = 0; column <= 6; column++)
                {
                    if (((row == 0 || row == 6) && column >= 0 && column <= 6) || row + column == 6)
                        Console.Write("*");
                    else
                        Console.Write(" ");
                }
                Console.Write("\n");
            }
            Console.Write("\n");
        }
    }

    Thursday, March 22, 2018 5:28 AM
  • THIS code is for second level of my game where children needs to overwrite the letter.this code is for console application c#.but i want to convet it into form application can u help me out here.
    Thursday, March 22, 2018 5:32 AM
  • THIS code is for second level of my game where children needs to overwrite the letter.this code is for console application c#.but i want to convet it into form application can u help me out here.

    Hi

    The forum members willingly help, but just grabbing code from somewhere and expecting others to do the work for you is really not done.

    There are free to use converters available - just search for 'convert c# to VB' and you willfind many.

    Did you notice/read my last post - it would be nice if you commented on it being not suitable or whatever rather than just ignoring it.


    Regards Les, Livingston, Scotland

    Thursday, March 22, 2018 5:46 AM
  • Hi

    Just in case my code was along the lines of what you wanted, here is the code with Mouse draw - user can 'trace' the letters by mouse click/drag.

    This version needs a Button1 on Form1 as well as the ComboBox1.

    Option Strict On
    Option Explicit On
    Imports System.Drawing.Drawing2D
    Public Class Form1
      Dim letterpath As New GraphicsPath
      Dim mousePath As New GraphicsPath
      Dim letterPen As New Pen(Color.Black, 2)
      Dim UserPen As New Pen(Color.Red, 8)
      Dim currentletter As String
      Dim MouseFlag As Boolean = False
      Dim letters As New List(Of String)
      Dim pos As New Point(20, 60)
    
      ' configure display font here
      Dim letterfont As New Font("Arial", 64, FontStyle.Bold)
    
      Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    	DoubleBuffered = True
    
    	' add whatever is needed as selection to trace
    	' can be characters, words or phrases
    	' but size and space available may limit
    	' what can be shown.
    	letters.Add("Use MOUSE to trace")
    
    	letters.Add("WORDS or Letters")
    	For i As Integer = 65 To 90
    	  letters.Add(ChrW(i))
    	Next
    
    	ComboBox1.DataSource = letters
    	ComboBox1.SelectedIndex = 0
      End Sub
      Private Sub Form1_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
    	letterpath.AddString(currentletter, letterfont.FontFamily, letterfont.Style, letterfont.SizeInPoints, pos, StringFormat.GenericDefault)
    	e.Graphics.DrawPath(letterPen, letterpath)
    	letterpath.Reset()
    	e.Graphics.DrawPath(UserPen, mousePath)
      End Sub
      Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
    	currentletter = ComboBox1.SelectedItem.ToString
    	mousePath.Reset()
    	Invalidate()
      End Sub
      Private Sub Form1_MouseDown(sender As Object, e As MouseEventArgs) Handles MyBase.MouseDown
    	mousePath.AddLine(New Point(e.X, e.Y), New Point(e.X, e.Y))
    	MouseFlag = True
      End Sub
      Private Sub Form1_MouseUp(sender As Object, e As MouseEventArgs) Handles Me.MouseUp
    	mousePath.StartFigure()
    	MouseFlag = False
      End Sub
      Private Sub Form1_MouseMove(sender As Object, e As MouseEventArgs) Handles Me.MouseMove
    	If MouseFlag Then mousePath.AddLine(e.X, e.Y, e.X, e.Y)
    	Invalidate()
      End Sub
      Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    	mousePath.Reset()
    	Invalidate()
      End Sub
    End Class


    Regards Les, Livingston, Scotland

    Thursday, March 22, 2018 8:57 AM
  • THIS code is for second level of my game where children needs to overwrite the letter.this code is for console application c#.but i want to convet it into form application can u help me out here.

    Hi

    The forum members willingly help, but just grabbing code from somewhere and expecting others to do the work for you is really not done.

    There are free to use converters available - just search for 'convert c# to VB' and you willfind many.

    Did you notice/read my last post - it would be nice if you commented on it being not suitable or whatever rather than just ignoring it.


    Regards Les, Livingston, Scotland

    Actually i have to finish my university project by the mid of april and i m not that good in programing so  i need help very badly....pls try to help me

    Thursday, March 22, 2018 1:41 PM
  • Hi

    As a possible alternative, consider this. This is a stand alone example project.

    The aim here would be to 'trace' the letter inside the character outline rather than the 'arrow' method you mention.

    The Font and size can be adjusted to suit.

    The character can be selected from the ComboBox (indeed, any string or set of characters could be shown - i.e. full words)

    This is just an example and is not embellished in any way.

    If you want to try it, you will need a default ComboBox1 on Form1.

    Option Strict On
    Option Explicit On
    Imports System.Drawing.Drawing2D
    Public Class Form1
      Dim path As New GraphicsPath
      Dim letters As New List(Of String)
      Dim currentletter As String
      Dim myPen As New Pen(Color.Black, 2)
    
      ' configure font and position here
      Dim pos As New Point(80, 0)
      Dim fnt As New Font("Consolas", 96, FontStyle.Bold)
      Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    	For i As Integer = 65 To 90
    	  letters.Add(ChrW(i))
    	Next
    	ComboBox1.DataSource = letters
    	ComboBox1.SelectedIndex = 0
      End Sub
      Private Sub Form1_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
    	path.AddString(currentletter, fnt.FontFamily, fnt.Style, fnt.SizeInPoints, pos, StringFormat.GenericDefault)
    	e.Graphics.DrawPath(myPen, path)
    	path.Reset()
      End Sub
      Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
    	currentletter = ComboBox1.SelectedItem.ToString
    	Invalidate()
      End Sub
    End Class


    Regards Les, Livingston, Scotland


    can we write here from A to z
    Thursday, March 22, 2018 1:57 PM
  • No offense but from your comments I doubt you can do this project. You should pick something you have a chance of doing and learning on your own.

    :)

    Imports System.Drawing.Drawing2D
    
    Public Class Form3
        Private WithEvents timer1 As New System.Windows.Forms.Timer With {.Interval = 200, .Enabled = False}
        Private WithEvents button1 As New Button With {.Parent = Me, .Location = New Point(150, 200), .Text = "go"}
        Private _A() As PointF = {New PointF(2, 0), New PointF(5, 10),
                New PointF(5, 10), New PointF(8, 0),
                New PointF(3, 4), New PointF(7, 4)}
        Dim section As Integer
        Dim lastx, lasty, dx, dy As Single
    
        Private Sub Form3_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
            Dim scale As Single = 20
            Dim r As Single = CSng(ClientSize.Height / scale)
    
            With e.Graphics
                .Clear(Color.Black)
                .SmoothingMode = SmoothingMode.AntiAlias
                .ScaleTransform(r, -r)
                .TranslateTransform(CSng(0.33 * scale), CSng(-0.67 * scale))
    
                Using p As Pen = New Pen(Color.SkyBlue, 0.4),
                        p2 As Pen = New Pen(Color.Red, 0.5)
    
                    'draw the letter
                    For i As Integer = 0 To _A.Count - 1 Step 2
                        .DrawLine(p, _A(i).X, _A(i).Y, _A(i + 1).X, _A(i + 1).Y)
                    Next
    
                    'draw the arrow
                    If lastx > 0 Then
                        DrawArrow(e.Graphics, p2, 1, lastx, lasty, _A(section + 1).X, _A(section + 1).Y)
                    End If
    
                End Using
            End With
        End Sub
    
        Private Sub DrawArrow(g As Graphics, p As Pen, l As Single, x1 As Single, y1 As Single, x2 As Single, y2 As Single)
            Dim angle As Single = CSng(Math.Atan2(y1 - y2, x1 - x2) * 57.3)
            Dim rect As RectangleF = New RectangleF(lastx - (l / 2), lasty - (l / 2), l, l)
            g.DrawPie(p, rect, angle - 25, 50)
        End Sub
    
        Private Sub timer1_Tick(sender As Object, e As EventArgs) Handles timer1.Tick
    
            If section = 0 And dx = 0 Then
                lastx = _A(section).X
                lasty = _A(section).Y
            End If
    
            If dx = 0 Then
                dx = (_A(section + 1).X - _A(section).X) / 10
                dy = (_A(section + 1).Y - _A(section).Y) / 10
            End If
    
            lastx += dx
            lasty += dy
    
            If lastx > _A(section + 1).X Then
    
                section += 2
                dx = 0
    
                If section > _A.Count - 1 Then
                    timer1.Stop()
                    section = 0
                    lastx = 0
                Else
                    lastx = _A(section).X
                    lasty = _A(section).Y
                End If
            End If
    
            Invalidate()
    
        End Sub
    
        Private Sub button1_Click(sender As Object, e As EventArgs) Handles button1.Click
            timer1.Start()
        End Sub
    
        Private Sub Form3_Load(sender As Object, e As EventArgs) Handles Me.Load
            DoubleBuffered = True
        End Sub
    End Class

    • Marked as answer by SKG123 Thursday, March 22, 2018 5:06 PM
    • Unmarked as answer by SKG123 Thursday, March 22, 2018 5:06 PM
    • Marked as answer by SKG123 Thursday, March 22, 2018 5:06 PM
    Thursday, March 22, 2018 2:43 PM
  • Hi

    Yes, see the comments on my posts.


    Regards Les, Livingston, Scotland

    Thursday, March 22, 2018 3:51 PM
  • No offense but from your comments I doubt you can do this project. You should pick something you have a chance of doing and learning on your own.

    :)

    Imports System.Drawing.Drawing2D
    
    Public Class Form3
        Private WithEvents timer1 As New System.Windows.Forms.Timer With {.Interval = 200, .Enabled = False}
        Private WithEvents button1 As New Button With {.Parent = Me, .Location = New Point(150, 200), .Text = "go"}
        Private _A() As PointF = {New PointF(2, 0), New PointF(5, 10),
                New PointF(5, 10), New PointF(8, 0),
                New PointF(3, 4), New PointF(7, 4)}
        Dim section As Integer
        Dim lastx, lasty, dx, dy As Single
    
        Private Sub Form3_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
            Dim scale As Single = 20
            Dim r As Single = CSng(ClientSize.Height / scale)
    
            With e.Graphics
                .Clear(Color.Black)
                .SmoothingMode = SmoothingMode.AntiAlias
                .ScaleTransform(r, -r)
                .TranslateTransform(CSng(0.33 * scale), CSng(-0.67 * scale))
    
                Using p As Pen = New Pen(Color.SkyBlue, 0.4),
                        p2 As Pen = New Pen(Color.Red, 0.5)
    
                    'draw the letter
                    For i As Integer = 0 To _A.Count - 1 Step 2
                        .DrawLine(p, _A(i).X, _A(i).Y, _A(i + 1).X, _A(i + 1).Y)
                    Next
    
                    'draw the arrow
                    If lastx > 0 Then
                        DrawArrow(e.Graphics, p2, 1, lastx, lasty, _A(section + 1).X, _A(section + 1).Y)
                    End If
    
                End Using
            End With
        End Sub
    
        Private Sub DrawArrow(g As Graphics, p As Pen, l As Single, x1 As Single, y1 As Single, x2 As Single, y2 As Single)
            Dim angle As Single = CSng(Math.Atan2(y1 - y2, x1 - x2) * 57.3)
            Dim rect As RectangleF = New RectangleF(lastx - (l / 2), lasty - (l / 2), l, l)
            g.DrawPie(p, rect, angle - 25, 50)
        End Sub
    
        Private Sub timer1_Tick(sender As Object, e As EventArgs) Handles timer1.Tick
    
            If section = 0 And dx = 0 Then
                lastx = _A(section).X
                lasty = _A(section).Y
            End If
    
            If dx = 0 Then
                dx = (_A(section + 1).X - _A(section).X) / 10
                dy = (_A(section + 1).Y - _A(section).Y) / 10
            End If
    
            lastx += dx
            lasty += dy
    
            If lastx > _A(section + 1).X Then
    
                section += 2
                dx = 0
    
                If section > _A.Count - 1 Then
                    timer1.Stop()
                    section = 0
                    lastx = 0
                Else
                    lastx = _A(section).X
                    lasty = _A(section).Y
                End If
            End If
    
            Invalidate()
    
        End Sub
    
        Private Sub button1_Click(sender As Object, e As EventArgs) Handles button1.Click
            timer1.Start()
        End Sub
    
        Private Sub Form3_Load(sender As Object, e As EventArgs) Handles Me.Load
            DoubleBuffered = True
        End Sub
    End Class

    YES, Its true but my guide assigned me this project and asked to complete...i m in so much trouble

    .....dont know what to do ....by the can i create for other letters like BCD....and so on if so where are the changes that need to be done

    Thursday, March 22, 2018 5:11 PM

  • YES, Its true but my guide assigned me this project and asked to complete...i m in so much trouble

    .....dont know what to do ....by the can i create for other letters like BCD....and so on if so where are the changes that need to be done

    Of course the other letters can be done.

    However you should learn how this one works first.

    Then continue to add the other letters somehow if this is what you want to do.

    See the array of points at the start I named _A? It is the endpoints of the three lines for A in the order you want to draw them ie animate them. The letter is 10 units high and that is scaled to the form in the paint event.

    So why dont you do one? All you have to do is make the array. Not sure what kind of bugs may appear with other letters and directions etc. How about the letter T thats easy. I made the A 8 x 10 units so try to do that. The top of the t would be edit: (1,0)-(9,0) and the center is (5,0)-(5,10).

    Then, you will need to do some curved letters somehow. Draw them with lines? Or you need to introduce an arc into the whole process. You could lay them out on graph paper by hand.

    So you could end up with a list of letters. Somehow the letter to show is specified and then call the animation routine to draw the pattern.


    PS There are many many ways to do things. This just happens to be what I came up with. There are other ways and probably better ways. We just have to use what we know how to use.



    Thursday, March 22, 2018 6:07 PM

  • YES, Its true but my guide assigned me this project and asked to complete...i m in so much trouble

    .....dont know what to do ....by the can i create for other letters like BCD....and so on if so where are the changes that need to be done

    Of course the other letters can be done.

    However you should learn how this one works first.

    Then continue to add the other letters somehow if this is what you want to do.

    See the array of points at the start I named _A? It is the endpoints of the three lines for A in the order you want to draw them ie animate them. The letter is 10 units high and that is scaled to the form in the paint event.

    So why dont you do one? All you have to do is make the array. Not sure what kind of bugs may appear with other letters and directions etc. How about the letter T thats easy. I made the A 8 x 10 units so try to do that. The top of the t would be edit: (1,0)-(9,0) and the center is (5,0)-(5,10).

    Then, you will need to do some curved letters somehow. Draw them with lines? Or you need to introduce an arc into the whole process. You could lay them out on graph paper by hand.

    So you could end up with a list of letters. Somehow the letter to show is specified and then call the animation routine to draw the pattern.


    PS There are many many ways to do things. This just happens to be what I came up with. There are other ways and probably better ways. We just have to use what we know how to use.



    K THANKS i will try to do it for other letters to...
    Friday, March 23, 2018 2:57 AM
  • No offense but from your comments I doubt you can do this project. You should pick something you have a chance of doing and learning on your own.

    :)

    Show off..... ;)


    La vida loca

    Saturday, March 24, 2018 2:36 AM
  • SKG123,

      Perhaps you can consider creating a small application which you can use to trace each letter with the mouse and store the mouse location (Points) in a temporary List(Of Point).  Make this small app so you can replay the movements.  When you are satisfied with the way it plays the movements back,  you can save the Points to an xml,  text,  csv,  or even a database file.

     Then you can use the saved file or files with the application that the client is using.

     For example,  here I select a Letter 'R',  then trace it with the mouse,  and then play it back.  If I wanted to redo the letter,  I can clear the points with the Clear button and trace it again.  If I am satisfied with the playback,  I can save the Points to a file which can be used by the client's application.


    If you say it can`t be done then i`ll try it

    Saturday, March 24, 2018 1:05 PM
  • No offense but from your comments I doubt you can do this project. You should pick something you have a chance of doing and learning on your own.

    :)

    Imports System.Drawing.Drawing2D
    
    Public Class Form3
        Private WithEvents timer1 As New System.Windows.Forms.Timer With {.Interval = 200, .Enabled = False}
        Private WithEvents button1 As New Button With {.Parent = Me, .Location = New Point(150, 200), .Text = "go"}
        Private _A() As PointF = {New PointF(2, 0), New PointF(5, 10),
                New PointF(5, 10), New PointF(8, 0),
                New PointF(3, 4), New PointF(7, 4)}
        Dim section As Integer
        Dim lastx, lasty, dx, dy As Single
    
        Private Sub Form3_Paint(sender As Object, e As PaintEventArgs) Handles Me.Paint
            Dim scale As Single = 20
            Dim r As Single = CSng(ClientSize.Height / scale)
    
            With e.Graphics
                .Clear(Color.Black)
                .SmoothingMode = SmoothingMode.AntiAlias
                .ScaleTransform(r, -r)
                .TranslateTransform(CSng(0.33 * scale), CSng(-0.67 * scale))
    
                Using p As Pen = New Pen(Color.SkyBlue, 0.4),
                        p2 As Pen = New Pen(Color.Red, 0.5)
    
                    'draw the letter
                    For i As Integer = 0 To _A.Count - 1 Step 2
                        .DrawLine(p, _A(i).X, _A(i).Y, _A(i + 1).X, _A(i + 1).Y)
                    Next
    
                    'draw the arrow
                    If lastx > 0 Then
                        DrawArrow(e.Graphics, p2, 1, lastx, lasty, _A(section + 1).X, _A(section + 1).Y)
                    End If
    
                End Using
            End With
        End Sub
    
        Private Sub DrawArrow(g As Graphics, p As Pen, l As Single, x1 As Single, y1 As Single, x2 As Single, y2 As Single)
            Dim angle As Single = CSng(Math.Atan2(y1 - y2, x1 - x2) * 57.3)
            Dim rect As RectangleF = New RectangleF(lastx - (l / 2), lasty - (l / 2), l, l)
            g.DrawPie(p, rect, angle - 25, 50)
        End Sub
    
        Private Sub timer1_Tick(sender As Object, e As EventArgs) Handles timer1.Tick
    
            If section = 0 And dx = 0 Then
                lastx = _A(section).X
                lasty = _A(section).Y
            End If
    
            If dx = 0 Then
                dx = (_A(section + 1).X - _A(section).X) / 10
                dy = (_A(section + 1).Y - _A(section).Y) / 10
            End If
    
            lastx += dx
            lasty += dy
    
            If lastx > _A(section + 1).X Then
    
                section += 2
                dx = 0
    
                If section > _A.Count - 1 Then
                    timer1.Stop()
                    section = 0
                    lastx = 0
                Else
                    lastx = _A(section).X
                    lasty = _A(section).Y
                End If
            End If
    
            Invalidate()
    
        End Sub
    
        Private Sub button1_Click(sender As Object, e As EventArgs) Handles button1.Click
            timer1.Start()
        End Sub
    
        Private Sub Form3_Load(sender As Object, e As EventArgs) Handles Me.Load
            DoubleBuffered = True
        End Sub
    End Class

    ACTUALLY I NEED THIS TO BE DONE IN WINDOW FORM C#
    Monday, March 26, 2018 6:57 AM
  • ACTUALLY I NEED THIS TO BE DONE IN WINDOW FORM C#

     In that case,  you should have asked this question in the C# forum (link below) instead of the Vb.Net forum.  There are code converters that you can use to convert the VB.Net code to C# such as Telerik Code Converter.

    Social msdn - C# Forum


    If you say it can`t be done then i`ll try it

    Monday, March 26, 2018 9:39 AM
  • No offense but from your comments I doubt you can do this project. You should pick something you have a chance of doing and learning on your own.

    :)


    ACTUALLY I NEED THIS TO BE DONE IN WINDOW FORM C#
    Well I would say you have a lot of studying and learning to do before you proceed SKG123. It's not going to be a 5 minute effort to get these type of results.

    La vida loca

    Tuesday, March 27, 2018 2:48 AM

  • If you say it can`t be done then i`ll try it

    Another spiffy animated .Gif from showoff nr 2 ;)

    La vida loca

    Tuesday, March 27, 2018 2:49 AM
  • I WANT TO MOVE ARROW ON MY LETTER IN THIS MANNER HOW CAN I DO THAT PLEASE HELP.....
    • Merged by Stanly Fan Friday, March 30, 2018 5:39 AM the same thread
    Thursday, March 29, 2018 7:17 AM

  • If you say it can`t be done then i`ll try it

    Another spiffy animated .Gif from showoff nr 2 ;)

    La vida loca

    PLEASE CREATE THIS GIF  FILES FOR OTHER LETTERS ALSO...PLEASE HELP....

    Friday, March 30, 2018 5:50 AM

  • If you say it can`t be done then i`ll try it

    Another spiffy animated .Gif from showoff nr 2 ;)

    La vida loca

    PLEASE CREATE THIS GIF  FILES FOR OTHER LETTERS ALSO...PLEASE HELP....


    What? Your "guide" assigned you a project and you want anybody elses effort to complete the project for you? I doubt that is what your "guide" had in mind. And for a University project too! Ain't plagiarism great!!!

    La vida loca

    Saturday, March 31, 2018 2:03 AM

  • If you say it can`t be done then i`ll try it

    Another spiffy animated .Gif from showoff nr 2 ;)

    La vida loca

    PLEASE CREATE THIS GIF  FILES FOR OTHER LETTERS ALSO...PLEASE HELP....


    What? Your "guide" assigned you a project and you want anybody elses effort to complete the project for you? I doubt that is what your "guide" had in mind. And for a University project too! Ain't plagiarism great!!!

    La vida loca

    k i will do it my self ...thanks for u r help....
    Saturday, March 31, 2018 10:37 AM