Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 401239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:00:57+00:00 2026-05-12T17:00:57+00:00

So what I am trying to do is to have a set UI with

  • 0

So what I am trying to do is to have a set UI with certain controls, and I want to have some class instance to fill in the values.

For instance:

Classes that can populate the UI:

Sharpen, Blur, Smear, ... : FilterBase

So whenever the user creates an instances of the above classes, I want to automatically fetch the values based on the UI controls, by using the class instance.

The UI has items like:

.Name (TextBox)
.Amount (NumericUpDown)
.Decay (NumericUpDown)

So if the current instance is s = new Sharpen(), I want to get s.Name to fill out UI.Name.

How do I do this in the best possible way? Elegancy, clarity, performance wise, etc.

I am gonna use reflection, but how do I store the instance of the object (Sharpen, …) and be type safe? Should I use an System.Object instead? Or T?

public partial class ParamsUI
{
    T CurrentFilter (?)
    ...
}

Also if I use T, how will I know what to cast it to?

Is there a better way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:00:58+00:00Added an answer on May 12, 2026 at 5:00 pm

    Since this is using Windows Forms, the most flexible option would probably be to just use the Windows Forms PropertyGrid directly.

    You can do a lot of work to customize the look and feel of this. See Getting the Most Out of the .NET Framework PropertyGrid Control for details.


    Edit:

    If you want to have a very flexible, easy option, and WPF is an option (hosted within an ElementHost), you could consider using WPF.

    With this, you could host a UserControl containing nothing but a resource dictionary and a ContentControl.

    You could then make a custom XAML file for each item you want to edit, and setup a data template in the resources specifying the mapping of which user control (xaml) to use for each element you want to edit. You can then just set the element to the user control’s “DataContext” in code, and it will automatically wire everything up and “just work”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to set Session values using a IHttpModule. I have set the
The set-up: I have an android application that so far can register a user
I have two named instances of SQL Server 2008 and am trying to set
I am trying to set my DOS environment variable in Ruby, and have it
I'm trying to reorder/group a set of results using SQL. I have a few
All, I'm trying to set up a system whereby emails sent to a certain
I am trying to get a list of product id's that do not have
I want to allow my users to opt-out of certain email notifications. I'm trying
Some ASP.NET controls only permit items of certain types, for example: <uc:MyControl runat=server....> <MyTableTemplate>
I've been looking around trying to determine some Hibernate behavior that I'm unsure about.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.