none
How to program form components in low-level RRS feed

  • Question

  • Hello i am new with c#,

    i'm trying  to code form components like:

    tbar.Minimum = 0;  //trackbar
    tbar.Maximum = 100;  
    tbar.Value = 40; 

    I mean, i don't want to set values from 'Properties'. But i don't know how to open this window. How can i do this?

    Best regards.

     
    Saturday, July 20, 2019 8:26 AM

Answers

  • Hi MustafaUysal, 

    Thank you for posting here.

    According to your description, you don’t need to open specific window to set values.

    You can set form component’s values directly in events:

            private void Form1_Load(object sender, EventArgs e)
            {
                // Set the properties of trackbar in the form's load event.
                trackBar1.Minimum = 0;
                trackBar1.Maximum = 100;
                trackBar1.Value = 40;
            }

    Result:

    Besides, you can refer the following document about developing custom Windows Forms controls:

    Developing Custom Windows Forms Controls with the .NET Framework

    If I have any misunderstanding, you can provide more details about you problem.

    Best Regards,

    Xingyu Zhao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Ante Meridian Monday, July 22, 2019 4:13 AM
    • Marked as answer by MustafaUysal Wednesday, July 24, 2019 1:56 PM
    Monday, July 22, 2019 2:42 AM
    Moderator

All replies

  • The question is not clear. The way you have written the property assignment is correct for changing them from code. This will work as expected if you execute it from within the form that contains the control; you don't need to open the Properties window to do that.

    So you will need to explain with more detail what it is that you are trying to accomplish. It is not clear from your question.

    Sunday, July 21, 2019 6:52 AM
    Moderator
  • Hi MustafaUysal, 

    Thank you for posting here.

    According to your description, you don’t need to open specific window to set values.

    You can set form component’s values directly in events:

            private void Form1_Load(object sender, EventArgs e)
            {
                // Set the properties of trackbar in the form's load event.
                trackBar1.Minimum = 0;
                trackBar1.Maximum = 100;
                trackBar1.Value = 40;
            }

    Result:

    Besides, you can refer the following document about developing custom Windows Forms controls:

    Developing Custom Windows Forms Controls with the .NET Framework

    If I have any misunderstanding, you can provide more details about you problem.

    Best Regards,

    Xingyu Zhao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by Ante Meridian Monday, July 22, 2019 4:13 AM
    • Marked as answer by MustafaUysal Wednesday, July 24, 2019 1:56 PM
    Monday, July 22, 2019 2:42 AM
    Moderator