Click here to Skip to main content
15,921,212 members
Home / Discussions / C#
   

C#

 
AnswerRe: Removing $ from string Pin
Thomas Stockwell12-Jun-07 3:03
professionalThomas Stockwell12-Jun-07 3:03 
GeneralRe: Removing $ from string Pin
Not Active12-Jun-07 3:47
mentorNot Active12-Jun-07 3:47 
GeneralRe: Removing $ from string Pin
Thomas Stockwell12-Jun-07 4:06
professionalThomas Stockwell12-Jun-07 4:06 
GeneralRe: Removing $ from string Pin
ScottM112-Jun-07 3:48
ScottM112-Jun-07 3:48 
AnswerRe: Removing $ from string Pin
Giorgi Dalakishvili12-Jun-07 6:34
mentorGiorgi Dalakishvili12-Jun-07 6:34 
AnswerRe: Removing $ from string Pin
Scott Dorman13-Jun-07 4:32
professionalScott Dorman13-Jun-07 4:32 
Questioninstaller.log Pin
sarada_prasad12-Jun-07 2:27
sarada_prasad12-Jun-07 2:27 
QuestionKeeping a panel proportional Pin
sinosoidal12-Jun-07 2:04
sinosoidal12-Jun-07 2:04 
Hi,

I want to implement a preview area which i want it to have a proportional size to the display resolution.

I have a workspace which is a form which is docked fill to my main window.

This is my panel size adjust function:


private void AdjustLayoutEditorSizeToDisplay(int width, int height)<br />
        {<br />
            int panelHeight;<br />
<br />
            Console.WriteLine("Display size: " + width + " x " + height);<br />
            Console.WriteLine("tpLayout size: " + this.Size.Width + "x" + this.Size.Height);<br />
            Console.WriteLine("regionPanel initial size: " + regionsPanel.Size.Width + "x" + regionsPanel.Size.Height);<br />
            int percent = Utility.PixelsToPercent(this.Size.Width, width);<br />
            Console.WriteLine("The provided width is " + percent + "% of the maximum percentage.");<br />
<br />
            if (percent > 100)<br />
            {<br />
                int diff = percent - 100;<br />
                panelHeight = Utility.PercentToPixels(height, 100 - diff);<br />
                Console.WriteLine("The height calculated based on the percentage is " + panelHeight + ".");<br />
            }<br />
            else<br />
            {<br />
                panelHeight = Utility.PercentToPixels(height, percent);<br />
                Console.WriteLine("The height calculated based on the percentage is " + panelHeight + ".");<br />
            }<br />
            regionsPanel.Size = new Size(this.Size.Width, panelHeight);<br />
            Console.WriteLine("regionPanel final size: " + regionsPanel.Size.Width + "x" + regionsPanel.Size.Height);<br />
        }


I provide the resolution and suposly it will make the panel adjust its width to the workspace width and the height propotional to that.

But i found a problem, when docked, a panel seems to keep its original Size property and so it will not give me a correct proportion and it will not adjust its width to the workspace width.

WEll.. can somebody tell me if there is a turn around for this?

Thx,

Nuno
Questiontxt1_textchange() Pin
Laxmi R12-Jun-07 1:50
Laxmi R12-Jun-07 1:50 
AnswerRe: txt1_textchange() Pin
Christian Graus12-Jun-07 2:01
protectorChristian Graus12-Jun-07 2:01 
AnswerRe: txt1_textchange() Pin
Sylvester george12-Jun-07 2:08
Sylvester george12-Jun-07 2:08 
GeneralRe: txt1_textchange() Pin
Laxmi R12-Jun-07 2:38
Laxmi R12-Jun-07 2:38 
GeneralRe: txt1_textchange() Pin
Sylvester george12-Jun-07 2:44
Sylvester george12-Jun-07 2:44 
GeneralRe: txt1_textchange() Pin
Laxmi R12-Jun-07 3:01
Laxmi R12-Jun-07 3:01 
GeneralRe: txt1_textchange() Pin
Sylvester george12-Jun-07 19:13
Sylvester george12-Jun-07 19:13 
GeneralRe: txt1_textchange() Pin
Laxmi R12-Jun-07 19:45
Laxmi R12-Jun-07 19:45 
GeneralRe: txt1_textchange() Pin
Laxmi R13-Jun-07 20:56
Laxmi R13-Jun-07 20:56 
GeneralRe: txt1_textchange() Pin
Laxmi R13-Jun-07 20:57
Laxmi R13-Jun-07 20:57 
QuestionMaximize Button Pin
Ian Uy12-Jun-07 1:26
Ian Uy12-Jun-07 1:26 
AnswerRe: Maximize Button Pin
Martin#12-Jun-07 1:33
Martin#12-Jun-07 1:33 
AnswerRe: Maximize Button Pin
PandemoniumPasha12-Jun-07 1:34
PandemoniumPasha12-Jun-07 1:34 
QuestionReal-Time (?) updating of a file... Pin
Shy Agam12-Jun-07 1:19
Shy Agam12-Jun-07 1:19 
QuestionRegularly checking up a folder Pin
Hum Dum12-Jun-07 1:16
Hum Dum12-Jun-07 1:16 
AnswerRe: Regularly checking up a folder Pin
Giorgi Dalakishvili12-Jun-07 1:37
mentorGiorgi Dalakishvili12-Jun-07 1:37 
QuestionRe: Regularly checking up a folder Pin
Hum Dum12-Jun-07 18:44
Hum Dum12-Jun-07 18:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.