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 7985345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:31:39+00:00 2026-06-04T11:31:39+00:00

Ok I’ll try explain as best as possible. I have a method, HandleGraphic. This

  • 0

Ok I’ll try explain as best as possible.

I have a method, “HandleGraphic”. This method will be..Handling the opacity of a given control via a Logarithmic function.

The method parameters are: (object SendingObject, float From, float To)

My question is: How do I cast/bind the SendingObject in such a way as to directly be able to manipulate it’s values/properties?

For instance: Say the textbox calls the HandleGraphic method. The HandleGraphic needs the sending control’s Name property “txtbox” to adjust it’s Opacity property.

There must be a way of implementing a global function of casting or binding to directly access the calling object’s property.

For instance: SendingObject.Opacity = X;

Any help would be much appreciated.

  • 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-06-04T11:31:41+00:00Added an answer on June 4, 2026 at 11:31 am

    If you are talking about WPF (WinForms controls don’t have an Opacity property), both the Name and Opacity properties are members of Control (specifically System.Windows.Controls.Control). Why not change the signature of HandleGraphic to (Control control, float from, float to)? All controls derive from Control, so you can pass any of them to that method.

    Correction

    The Name property is a member of FrameworkElement and the Opacity property is a member of UIElement. So to work with both Name and Opacity property you need at minimum a FrameworkElement. Control will still work for your purpose, but you might want to aim for the lowest common denominator. For example, a TextBlock is not a Control, it derives directly from FrameworkElement.

    The hierarchy of controls in WPF is:

    Object
    DispatcherObject
    DependencyObject
    Visual
    UIElement
    FrameworkElement
    Control
    

    From there it gets complicated. For instance:

    Button : ButtonBase : ContentControl : Control
    TextBox : TextBoxBase : Control
    ComboBox : Selector : ItemsControl : Control
    DataGrid : MultiSelector : Selector : ItemsControl : Control
    

    But they all derive from Control which derives from FrameworkElement.

    The simplest way to find out the inheritance of a type is to put the caret on the type in your code and press F12. This gives you some pseudo-code describing the type (or actual code if it’s available) and you can navigate through the base classes the same way.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have a text area in my form which accepts all possible characters from
I have some data like this: 1 2 3 4 5 9 2 6
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.