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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Winforms Controls

Winforms Controls

Scheduled Pinned Locked Moved C#
csharpwinformshelpquestion
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.
  • M Offline
    M Offline
    Mankayarkarasi
    wrote on last edited by
    #1

    I am developing a project which features usercontrols like WinForms Controls. I have created controls like text box,picture,etc., Each control is a usercontrol and has its own properties.now the problem is when i select the usercontrol i have to get the rectangle that bounds the border of the control when you select a windows control. The user should know which control he/she has selected. Has anyone found a solution for this ? Thanks in advance:rose: Happy Coding MankayarKarasi

    D 1 Reply Last reply
    0
    • M Mankayarkarasi

      I am developing a project which features usercontrols like WinForms Controls. I have created controls like text box,picture,etc., Each control is a usercontrol and has its own properties.now the problem is when i select the usercontrol i have to get the rectangle that bounds the border of the control when you select a windows control. The user should know which control he/she has selected. Has anyone found a solution for this ? Thanks in advance:rose: Happy Coding MankayarKarasi

      D Offline
      D Offline
      DougW48
      wrote on last edited by
      #2

      You are making your own controls for textbox, picture, etc? Sounds like you're doing a LOT of work when you don't need to be. Either way, a user control should have a Bounds variable, and you can make your own rectangle object with the information the Bounds variable contains. Mankayarkarasi wrote: The user should know which control he/she has selected. I don't understand what you mean here. Are you trying to highlight the controls, or are there overlapped controls where the selected one needs brought to the front? Explain this a little more. If you need extra functionality for the controls that already exist in C#, it would be a LOT easier for you to create new classes that inherit the old controls...then just add your new functionality. Hope I helped out at least a little. Good luck - D :cool:

      M 1 Reply Last reply
      0
      • D DougW48

        You are making your own controls for textbox, picture, etc? Sounds like you're doing a LOT of work when you don't need to be. Either way, a user control should have a Bounds variable, and you can make your own rectangle object with the information the Bounds variable contains. Mankayarkarasi wrote: The user should know which control he/she has selected. I don't understand what you mean here. Are you trying to highlight the controls, or are there overlapped controls where the selected one needs brought to the front? Explain this a little more. If you need extra functionality for the controls that already exist in C#, it would be a LOT easier for you to create new classes that inherit the old controls...then just add your new functionality. Hope I helped out at least a little. Good luck - D :cool:

        M Offline
        M Offline
        Mankayarkarasi
        wrote on last edited by
        #3

        Thanks. The project I am working inherits few properties from Windows control. The User can create a report design of his own. so the controls will have the funcition similar to windows control. When you drag drop a control from Windows forms. A rubberband like highlight will be given to the control.This will be done easily in MFC using crectracker. In .NET I have dynamically calculated the corners for each control and with graphics has drawn rectangles to the edges. this provides a highlighted control. Happy Coding MankayarKarasi

        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