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. 2Questions: Application icon and username

2Questions: Application icon and username

Scheduled Pinned Locked Moved C#
questioncsharp
3 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
    DionChen
    wrote on last edited by
    #1

    Hi, all: I am writing WinForm App in C# and I have following two questions: 1. I modified App.ico in the project. when I rebuild the project, the icon in the Windows Explorer and shortcut changed to what I made. However the icon on the top right of the application titlebar did not change when I run my app. How can I add my own icon replace the default icon on the titlebar of the main window? 2. What is the easiest way to get current username? Thanks in advance. Dion

    D 1 Reply Last reply
    0
    • D DionChen

      Hi, all: I am writing WinForm App in C# and I have following two questions: 1. I modified App.ico in the project. when I rebuild the project, the icon in the Windows Explorer and shortcut changed to what I made. However the icon on the top right of the application titlebar did not change when I run my app. How can I add my own icon replace the default icon on the titlebar of the main window? 2. What is the easiest way to get current username? Thanks in advance. Dion

      D Offline
      D Offline
      Danny Blanchard
      wrote on last edited by
      #2

      1. There should be an Icon property for your form that you can access in the Designer view. Use that to find whatever icon you want displayed in the title bar for that particular form. I think you have to do this for each form you want the icon displayed in (unless anyone knows a better way). 2. Use System.Environment.UserName property to find the current user name. Hope that helps. Daniel E. Blanchard

      D 1 Reply Last reply
      0
      • D Danny Blanchard

        1. There should be an Icon property for your form that you can access in the Designer view. Use that to find whatever icon you want displayed in the title bar for that particular form. I think you have to do this for each form you want the icon displayed in (unless anyone knows a better way). 2. Use System.Environment.UserName property to find the current user name. Hope that helps. Daniel E. Blanchard

        D Offline
        D Offline
        DionChen
        wrote on last edited by
        #3

        Thanks. That works.

        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