Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Mobile
  4. Is my C.F. 2.0 crazy?.....Or not?

Is my C.F. 2.0 crazy?.....Or not?

Scheduled Pinned Locked Moved Mobile
graphicshelpcsharpvisual-studioquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    Hurricane3000
    wrote on last edited by
    #1

    Hi all, After it seems that I'm finding the way to resolve my previous problem, now I found another problem. Please read this simple line of code: Imports System Imports System.IO Imports System.Drawing.Graphics Imports System.Drawing.Color ---------------------------------------- TextBox1.BackColor = RGB(255, 255, 0) It generate the following error: Error 1 Value of type 'Integer' cannot be converted to 'System.Drawing.Color'. E:\Documents and Settings\MI\Documenti\Visual Studio 2005\Projects\TrackPlotter\TrackPlotter\Form1.vb 555 30 TrackPlotter I tryed the same line code in VB 5 with the expected result to colorize the Box yellow. Is my C.F. 2.0 crazy?.....Or not? Marco

    M 1 Reply Last reply
    0
    • H Hurricane3000

      Hi all, After it seems that I'm finding the way to resolve my previous problem, now I found another problem. Please read this simple line of code: Imports System Imports System.IO Imports System.Drawing.Graphics Imports System.Drawing.Color ---------------------------------------- TextBox1.BackColor = RGB(255, 255, 0) It generate the following error: Error 1 Value of type 'Integer' cannot be converted to 'System.Drawing.Color'. E:\Documents and Settings\MI\Documenti\Visual Studio 2005\Projects\TrackPlotter\TrackPlotter\Form1.vb 555 30 TrackPlotter I tryed the same line code in VB 5 with the expected result to colorize the Box yellow. Is my C.F. 2.0 crazy?.....Or not? Marco

      M Offline
      M Offline
      Mitch F
      wrote on last edited by
      #2

      I think the code that you would need to use is: TextBox1.BackColor = Color.FromArgb(255, 255, 0) Or: TextBox1.BackColor = Color.Yellow Also, make sure that you have the .Net CF Service Packs installed on your mobile device. (I had a few problems with coloring on my PPC before I installed the .Net CF SP2 on it) I hope this helps

      H 1 Reply Last reply
      0
      • M Mitch F

        I think the code that you would need to use is: TextBox1.BackColor = Color.FromArgb(255, 255, 0) Or: TextBox1.BackColor = Color.Yellow Also, make sure that you have the .Net CF Service Packs installed on your mobile device. (I had a few problems with coloring on my PPC before I installed the .Net CF SP2 on it) I hope this helps

        H Offline
        H Offline
        Hurricane3000
        wrote on last edited by
        #3

        Hi Mitch, Thanks for reply. I have .Net CF SP2 installed on both device and emulator (Windows Mobile 2003 SE). I know that the code that I would need to use is: TextBox1.BackColor = Color.FromArgb(255, 255, 0) The problem I described in the post is born while I was trying to resolve another previous and primary problem (actually unresolved). This is the main problem: 1)- I need to get an RGB vatue from a txt file (I.E. 65535 for Yellow). 2)- Convert it in Integer or Color (Result is the identical: Appl. retuns a color like Aquamarine instead of Yellow. 3)- Use this value as BackColor property for a TextBox. But........ TextBox1.BackColor = Color.FromArgb(255, 255, 0) work correctly (Colorize TextBox Yellow), but it's not good for my application. ------------------------------------------------------ TextBox1.BackColor = Color.FromArgb (65535) 'Color.FromArgb can accept also an RGB Value as single argument. '65535 is the RGB value of Yellow Don't work correctly (Colorize TextBox like Aquamarine instead of Yellow). -------------------------------------------------------- Are 3 days I'm working around....... But Nothing!

        modified on Thursday, April 10, 2008 10:54 AM

        H 1 Reply Last reply
        0
        • H Hurricane3000

          Hi Mitch, Thanks for reply. I have .Net CF SP2 installed on both device and emulator (Windows Mobile 2003 SE). I know that the code that I would need to use is: TextBox1.BackColor = Color.FromArgb(255, 255, 0) The problem I described in the post is born while I was trying to resolve another previous and primary problem (actually unresolved). This is the main problem: 1)- I need to get an RGB vatue from a txt file (I.E. 65535 for Yellow). 2)- Convert it in Integer or Color (Result is the identical: Appl. retuns a color like Aquamarine instead of Yellow. 3)- Use this value as BackColor property for a TextBox. But........ TextBox1.BackColor = Color.FromArgb(255, 255, 0) work correctly (Colorize TextBox Yellow), but it's not good for my application. ------------------------------------------------------ TextBox1.BackColor = Color.FromArgb (65535) 'Color.FromArgb can accept also an RGB Value as single argument. '65535 is the RGB value of Yellow Don't work correctly (Colorize TextBox like Aquamarine instead of Yellow). -------------------------------------------------------- Are 3 days I'm working around....... But Nothing!

          modified on Thursday, April 10, 2008 10:54 AM

          H Offline
          H Offline
          Hurricane3000
          wrote on last edited by
          #4

          Hi all, After 3 days I resolved problem explained above. I discovered that in .Net CF 2.0 (may be also others versions), statement Color.FromArgb(Red, Green, Blue) works as expected (correctly)if it's used to reproduce a color structure from a triade of the three R-G-B components values(one value for each component in the order R-G-B), but if it's used to reproduce a color structure from a color value (I.E. 65535 for yellow), it works with colors components values inverted. More exactely, it reproduce colors like statement: Color.FromArgb(Blue, Green, Red) And then, I resolved problem estracting each single component values from the single color value, and recombined them in Color.FromArgb(Red, Green, Blue), following the normal R-G-B sequence. Thanks Marco

          modified on Thursday, April 10, 2008 1:41 PM

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups