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. Change properties with button

Change properties with button

Scheduled Pinned Locked Moved C#
graphicsxmltutorialquestion
2 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.
  • D Offline
    D Offline
    Dave McCool
    wrote on last edited by
    #1

    I have a button and the code on its this: btnStartMnu.Image = System.Drawing.Image.FromFile("Themes\\WinME2\\WindowsMEButton1.bmp"); Sound.Play("Sounds\\Camera.wav",PlaySoundFlags.SND_ASYNC); MessageBox.Show("Theme changed to Windows ME 2!", "Theme Changed"); string appPath = Path.GetDirectoryName(Application.ExecutablePath); m_appSettings.Save(appPath + "\\Settings\\Settings.xml"); m_saved = true; When you click button, it changes its image and then saves the info in a XML file. What I want to know is how to add code so it will change the colour of a panel called pnlleft to red and panlright change its colour to yellow. How would you do this? Also is there a way to change a fileMenu colours well? In the end we're all just the same

    H 1 Reply Last reply
    0
    • D Dave McCool

      I have a button and the code on its this: btnStartMnu.Image = System.Drawing.Image.FromFile("Themes\\WinME2\\WindowsMEButton1.bmp"); Sound.Play("Sounds\\Camera.wav",PlaySoundFlags.SND_ASYNC); MessageBox.Show("Theme changed to Windows ME 2!", "Theme Changed"); string appPath = Path.GetDirectoryName(Application.ExecutablePath); m_appSettings.Save(appPath + "\\Settings\\Settings.xml"); m_saved = true; When you click button, it changes its image and then saves the info in a XML file. What I want to know is how to add code so it will change the colour of a panel called pnlleft to red and panlright change its colour to yellow. How would you do this? Also is there a way to change a fileMenu colours well? In the end we're all just the same

      H Offline
      H Offline
      hooray
      wrote on last edited by
      #2

      Hey, as long as you are in the same class you can simply use pnlleft.BackColor = Color.Red; (same with the other panel) for the filemenu it is bit more complicate - the can only change the backcolor of one item - so the only way i know to change it all would be to go through every item.

      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