dcsimg
Results 1 to 3 of 3

Thread: vb6 and mscomm

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2007
    Posts
    9

    vb6 and mscomm

    hello everyone!
    i am interfacing microcontroller to pc i am using vb6 mscomm control my vb code is enogh to display the text i am sending from microcontroller i have included a shape in my vb form i want to change the color of this shape with respect to different text sent by microcontroller
    please help me with some coding example this is my first post at this forum

    thanks.

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,692

    Re: vb6 and mscomm

    It depends on the text being sent, but generally it would be:
    Code:
    'assume Text is the text from the mc
    
      Select Case(Text)
        Case "G" 'the mc sent "G"
          'code to change the shape color to green
        Case "R" 'the mc sent "R"
          'code to change the shape color to red
        Case "GY" 'the mc sent "GY"
          'code to change the shape color to grey
      End Select
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2007
    Posts
    9

    Re: vb6 and mscomm

    thanks for the code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width