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. General Programming
  3. C#
  4. How tt handle a custom control in design mode

How tt handle a custom control in design mode

Scheduled Pinned Locked Moved C#
csharpvisual-studiodesignhelpquestion
4 Posts 3 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.
  • S Offline
    S Offline
    Sasuko
    wrote on last edited by
    #1

    I've created a custom control. I've create a property that allow me in design mode to load an image. I'm not able to save that image in resource file just as visual studio does when i try to load an image as background. Who can help me?

    R R 2 Replies Last reply
    0
    • S Sasuko

      I've created a custom control. I've create a property that allow me in design mode to load an image. I'm not able to save that image in resource file just as visual studio does when i try to load an image as background. Who can help me?

      R Offline
      R Offline
      rah_sin
      wrote on last edited by
      #2

      you can add the image to imagelist control and then can load the image from image list. rahul

      1 Reply Last reply
      0
      • S Sasuko

        I've created a custom control. I've create a property that allow me in design mode to load an image. I'm not able to save that image in resource file just as visual studio does when i try to load an image as background. Who can help me?

        R Offline
        R Offline
        RaviBattula
        wrote on last edited by
        #3

        Hi, Here I am sending sample application. After creating new application. From resources.resx desing I added icon (AddResources->AddExistingFile). From resources.resx view code I changed Resources\Alarm161.ico;System.Drawing.Icon to

        Resource:

        Resources\Alarm161.ico;System.Drawing.Bitmap

        Because I want to add bitmap to my Button. From form desing I added one button. In Button1_click(..) event I added this code

        Code:

        System.Drawing.Bitmap bitmap1 = WindowsApplication1.Properties.Resources.Alarm161; button1.Image = bitmap1;

        Ravi

        S 1 Reply Last reply
        0
        • R RaviBattula

          Hi, Here I am sending sample application. After creating new application. From resources.resx desing I added icon (AddResources->AddExistingFile). From resources.resx view code I changed Resources\Alarm161.ico;System.Drawing.Icon to

          Resource:

          Resources\Alarm161.ico;System.Drawing.Bitmap

          Because I want to add bitmap to my Button. From form desing I added one button. In Button1_click(..) event I added this code

          Code:

          System.Drawing.Bitmap bitmap1 = WindowsApplication1.Properties.Resources.Alarm161; button1.Image = bitmap1;

          Ravi

          S Offline
          S Offline
          Sasuko
          wrote on last edited by
          #4

          ok i know it, but the problem that it is manual. Visual Studio to set the background image for the panel doesn't make me to add the bitmap in resource with (AddResources->AddExistingFile), but just load it automaticaly. So how can i do the same?

          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