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

  • Home
  • SEARCH
  • 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 8053937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:00:51+00:00 2026-06-05T08:00:51+00:00

In code below, when you access the style property, I want it to be

  • 0

In code below, when you access the style property,
I want it to be accepting parameter-type: top, left, width etc…
so it’ll be inserted from intellisense firstly not to give you a chance
to accidentally misspell, forget or just for the sake of “automation” or however we call it, to be in the intellisense as an option to select from.

Instead of:

objectID.Style.Add("property", "Value"); 

you get offered by the available properties:

objectID.Style.Add(Top, "here you will hardcode manually"); 
objectID.Style.Add(Left, "100px");
objectID.Style.Add(Width, "230px"); // but every parameter that represents an object property 
        //such as: Top, Left Etc' ... i would like to have it as an option opposed, to hard coding it

I will be happy to give more detailed ideas of what I was thinking of…
with another example:

    DateTime fullDate = DateTime.Now;
    string ddays = fullDate.Day.ToString();
    string dmonth = fullDate.Month.ToString();
    string dyear = fullDate.Year.ToString();

How can I, with the code above, that takes parts of date and stores each into a string
representing the date, Day, Month, Year
Then to put it in a class so I can reuse it on other codes:

Label1.Text = Day; Label2.Text = Month; Label3.Text = Year;

Again what I want to achieve is that those values will be inside intellisense
when ever the App_Code has the so called “Class” we have built…

Same as with the style properties in first part of that thread.

As I am new to oop I would like to better comprehend from that example
what are field properties Types (your own) and classes, from this perspective too (those codes above)
I will really appreciate the right / detailed answer, with hope that one day, I would be able to help others too…

  • 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-05T08:00:53+00:00Added an answer on June 5, 2026 at 8:00 am

    For your first example, an enum is perfect:

    public enum StyleOptions { Top, Left, Width, etc }
    
    objectID.Style.Add(StyleOptions.Top, "here you will hardcode manually");
    

    For the second one, I’d recommend passing around a DateTime instead of separate strings. If you then want to show the separate parts in separate labels, then in the page/form/user control that has the boxes, do your Label1.Text = fullDate.Day.ToString(); (etc.) code.

    DateTime (a struct) and StyleOptions (an enum) are both types. classes are also types, (and are the most common types you’ll see in C#) but I’m not sure which classes you’re using here (whatever contains the methods where you’ve got your code snippets is almost certainly a class you’ve made). Fields are essentially variables that belong to instances of types (if non-static), or to the type itself (if static). Properties are accessed like fields, but are defined using methods, so you can do things like lazy-loading and notify when properties changed on get and set. If that’s not too clear, see Difference between Property and Field in C# 3.0+, and Fields and Properties documentation.

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

Sidebar

Related Questions

I have a WPF button style below: <Style x:Key=myButtonStyle TargetType={x:Type Button}> <Setter Property=Template> <Setter.Value>
Below is le code. I want movementCanvas underneath canvas. <html> <head> <script type=text/javascript src=game.js></script>
I have a C extension (code below) in which I'm trying to get access
I am trying to access an SQLite 3 database programmatically using the code below:
How can this code compile? The code below in the operator int CAN access
Below is the code that I'm using in ms access to list the data
Code below is used to save PostgreSql database backup from browser in Apache Mono
I have the below code in my jqgrid <script type=text/javascript> jQuery(document).ready(function() { var grid
I use the code below to access the properties on my form,but today I'd
Code below: [HttpGet] public ActionResult Edit(string id=) { // ... } [HttpPost] public ActionResult

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.