Click here to Skip to main content
15,885,216 members
Home / Discussions / C#
   

C#

 
Questionhow can we change the input locale programmatically using C# Pin
g_hemanth1710-Mar-08 0:22
g_hemanth1710-Mar-08 0:22 
GeneralRe: how can we change the input locale programmatically using C# Pin
ChandraRam10-Mar-08 1:29
ChandraRam10-Mar-08 1:29 
QuestionRe: how can we change the input locale programmatically using C# Pin
g_hemanth1710-Mar-08 18:09
g_hemanth1710-Mar-08 18:09 
QuestionFormBorderStyle set to None with Context Menu on taskbar? Pin
lordkaile10-Mar-08 0:22
lordkaile10-Mar-08 0:22 
GeneralSplitcontainer SplitterDistance increases in every time Pin
AndrusM10-Mar-08 0:09
AndrusM10-Mar-08 0:09 
GeneralRe: Splitcontainer SplitterDistance increases in every time Pin
LongRange.Shooter10-Mar-08 8:51
LongRange.Shooter10-Mar-08 8:51 
GeneralRe: Splitcontainer SplitterDistance increases in every time Pin
AndrusM11-Mar-08 7:53
AndrusM11-Mar-08 7:53 
GeneralRe: Splitcontainer SplitterDistance increases in every time Pin
LongRange.Shooter11-Mar-08 16:56
LongRange.Shooter11-Mar-08 16:56 
In this example, you are computing the distance instead of defining a specific distance. So what is happening with this:
protected override void OnResize(EventArgs 3)
{
     if ( Settings != null && Settings.SplitterDistance >0m && settings.SplitterDistance < 100m)
         splitContainer1.SplitterDistance = ....your math
     base.OnResize(e);
}


First you say you are only going to calculate a splitter distance if the distance is less than 100m.
You then compute by multiplying the distance by the height/100m. Your height is just a teensy bit smaller than your splitter distance.

So your height/100m will be a decimal since the height of splitcontainer1.Height being less than 100 causes the splitter distance to be less than 100. Not only will it be a decimal but it will be a decimal less than 1.

So now when you compute the splitter distance you are shrinking the distance by whatever the decimal amount is. So if my height is 50 then you've just moved in the splitter distance by 50%. ( distance * 50/100 -OR - distance * .50 )

Now you do something causing another resize event. Assuming you did not move the splitter itself then you are guaranteed of the fact that you are less than 100m. So when you catch that event you will move it once again.....only a smaller percentage this time. But each time you move it you will make it smaller and smaller because you are mulitplying it by a number smaller than 1.

Either do one of two things: leave it be where it ends up -- or determine a good place to have it in a fixed location. So maybe having it 100 pixels out is good. Then set the splitter distance to 100 every time you get a resize (unless the entire window is less than that).
GeneralRe: Splitcontainer SplitterDistance increases in every time Pin
AndrusM12-Mar-08 2:40
AndrusM12-Mar-08 2:40 
GeneralRe: Splitcontainer SplitterDistance increases in every time Pin
henkiepl22-Sep-10 21:02
henkiepl22-Sep-10 21:02 
QuestionAdd,Amend data from DataGridView Pin
Krazy Programmer9-Mar-08 23:45
Krazy Programmer9-Mar-08 23:45 
GeneralRe: Add,Amend data from DataGridView Pin
LongRange.Shooter13-Mar-08 5:01
LongRange.Shooter13-Mar-08 5:01 
Generalnumeric validation problem Pin
Miss Maheshwari9-Mar-08 23:27
Miss Maheshwari9-Mar-08 23:27 
GeneralRe: numeric validation problem Pin
Xmen Real 9-Mar-08 23:36
professional Xmen Real 9-Mar-08 23:36 
GeneralRe: numeric validation problem Pin
Miss Maheshwari9-Mar-08 23:40
Miss Maheshwari9-Mar-08 23:40 
GeneralRe: numeric validation problem Pin
N a v a n e e t h9-Mar-08 23:43
N a v a n e e t h9-Mar-08 23:43 
GeneralRe: numeric validation problem Pin
Miss Maheshwari9-Mar-08 23:49
Miss Maheshwari9-Mar-08 23:49 
GeneralRe: numeric validation problem Pin
N a v a n e e t h9-Mar-08 23:52
N a v a n e e t h9-Mar-08 23:52 
GeneralRe: numeric validation problem Pin
Miss Maheshwari10-Mar-08 0:01
Miss Maheshwari10-Mar-08 0:01 
GeneralRe: numeric validation problem Pin
Anthony Mushrow10-Mar-08 0:04
professionalAnthony Mushrow10-Mar-08 0:04 
Generalsaving files from database Pin
Icarus1239-Mar-08 22:41
Icarus1239-Mar-08 22:41 
GeneralRe: saving files from database Pin
Vasudevan Deepak Kumar9-Mar-08 22:47
Vasudevan Deepak Kumar9-Mar-08 22:47 
GeneralRe: saving files from database Pin
Icarus1239-Mar-08 22:54
Icarus1239-Mar-08 22:54 
GeneralRe: saving files from database Pin
Christian Graus9-Mar-08 23:28
protectorChristian Graus9-Mar-08 23:28 
GeneralRe: saving files from database Pin
Icarus1239-Mar-08 23:44
Icarus1239-Mar-08 23: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.