Question

I have a custom XRPanel which inerhits from XRPanel class. Now i want that other programmers can use my own XRPanel in Report-Designer. They should pull it on report from there toolbox and some basic values initilize in constructor. But i cant figure out how to set a size for my XRPanel. Here is what iam doing in constructor:

    public myControl()
    {            
        this.SizeF = new SizeF(300, 300);
        XRLabel mylabel = new XRLabel();
        mylabel.Text = string.Format("Test{0}Test",Enviroment.NewLine);
        mylabel.Visible = true;
        mylabel.LocationF = new PointF(10, 10);
        mylabel.SizeF = new SizeF(200, 200);
        this.Controls.Add(mylabel);
    }

If i create new Report and pull the myControl from toolbox it is nearly working as expected. It shows a Panel with a Label on it and the Label is filled with some text. But the Panel isnt 300x300 Pixel. It is just 300x75! Same Problem with the Size of the Label.

Someone here can help me? Cant understand this behaviour because the constructor is called in Designer and the rest of code is working.

Was it helpful?

Solution

I got the solution. I have to override the SetBounds Method.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top