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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:31:17+00:00 2026-05-15T09:31:17+00:00

EDITED FOR BETTER UNDERSTANDING I made a custom control with propertise for some global

  • 0

EDITED FOR BETTER UNDERSTANDING

I made a custom control with propertise for some global variables.

private string[] LBTitles = new string[1] { "Rien" };
//...
[CategoryAttribute("WildData"), DescriptionAttribute("Tableau des noms des titres au dessus de le listbox")]
public string[] Titles
{
    get { return LBTitles; }

    set { LBTitles = value; OnColumns(EventArgs.Empty); }
}

OnColums does many things to format the control.
One among others is:

int vLongest = 0;
//...
//Si le plus long est plus petit que le titre de la colonne
if (vLongest < LBTitles[i].Length)
{
    vLongest = LBTitles[i].Length;
}

The above is for my control itself. Everything work fine, its a wonderful day, etc.

Now when it comes to add it to a form:
– I add it, everything is ok
– I modify the properties via the design, everything is ok
– I try to run it… there is the problem.

When I build, it add into InitializeComponent() the following code:

this.wildList1 = new WildList.WildList();
//Which is ok but also it add, everytime I build, this:
            // 
            // wildList1
            // 
            this.wildList1.Colors = new string[] {
        null};
            this.wildList1.Font = new System.Drawing.Font("Courier New", 8F);
            this.wildList1.Location = new System.Drawing.Point(211, 33);
            this.wildList1.Name = "wildList1";
            this.wildList1.Positions = new int[] {
        0};
            this.wildList1.Size = new System.Drawing.Size(238, 224);
            this.wildList1.TabIndex = 16;
            this.wildList1.Titles = new string[] {
        null};

It add lines of code that reset my arrays.
Why?
How can I get ride of them? Or at least, make them use the values entered by the programmer (aka me) into the designer?

Because when it goes throu the line that reset it, it also call the property “set”, which call OnColumns, which then try to do stuff with empty arrays, which cause a crash.

  • 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-15T09:31:18+00:00Added an answer on May 15, 2026 at 9:31 am

    I found out the problem.

    It was due to the reference of the dll of the control. It was using a “cached” or I dont know version of my control when I tested it for the first time (and was buggy), even if I was changing the .dll file that it was using. So I completely wiped the reference and made a new one with the unbugged version dll and everything work fine now.

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

Sidebar

Related Questions

(Edited to try to explain better) We have an agent, written in C++ for
Edit: I've edited the sample to better resemble the problem I have, now the
I've edited this post to better fit the scope of Stackoverflow: I have very
Note: i edited my Q (in the title) so that it better reflects what
Edited to better explain my problem I am trying to perform a zoom operation
(edited to give a better description of the answer I gave) I have created
Problem: edited files on windows, using git-bash, to fix IE7 problems committed, pushed to
I edited the question after David Hanak's answer (thanks btw!). He helped with the
This is a sample (edited slightly, but you get the idea) of my XML
I have HTML code edited by FCKEditor stored in a database and would like

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.