Click here to Skip to main content
15,893,622 members
Home / Discussions / C#
   

C#

 
GeneralRe: Is there any FIFO collection in .net 2.0? Pin
DaveAuld24-Aug-11 22:39
professionalDaveAuld24-Aug-11 22:39 
GeneralRe: Is there any FIFO collection in .net 2.0? Pin
Firo Atrum Ventus24-Aug-11 22:52
Firo Atrum Ventus24-Aug-11 22:52 
AnswerRe: Looking for FIFO Lock in .net 2.0? Pin
Luc Pattyn25-Aug-11 2:03
sitebuilderLuc Pattyn25-Aug-11 2:03 
QuestionHow to register .ocx file from code Pin
SajjadZare24-Aug-11 17:11
SajjadZare24-Aug-11 17:11 
AnswerRe: How to register .ocx file from code Pin
Hari Om Prakash Sharma24-Aug-11 17:31
Hari Om Prakash Sharma24-Aug-11 17:31 
GeneralRe: How to register .ocx file from code Pin
SajjadZare24-Aug-11 18:47
SajjadZare24-Aug-11 18:47 
AnswerRe: How to register .ocx file from code Pin
Shameel24-Aug-11 21:41
professionalShameel24-Aug-11 21:41 
QuestionStrange windows forms control bug? Pin
venomation24-Aug-11 13:21
venomation24-Aug-11 13:21 
I have the following code inside a Derived "Panel" control in C# 4:
C#
public void ForceMoveScrollBar(int distX, int distY)
{

    if (Math.Abs(distX) > HorizontalScroll.Maximum - HorizontalScroll.Value)
    {
        HorizontalScroll.Value = HorizontalScroll.Maximum;
    }
    else
    {
        HorizontalScroll.Value += distX;
    }
}


It is meant to scroll the horizontal scroll inside the panel by a certain amont when a key is clicked on the keyboard.

However I have to tap the key twice for it to work, the first time make my panel flicker and the second time works.

The only fix I have is:

C#
public void ForceMoveScrollBar(int distX, int distY)
       {

           if(Math.Abs(distX) >HorizontalScroll.Maximum - HorizontalScroll.Value)
           {
               HorizontalScroll.Value = HorizontalScroll.Maximum;
           }
           else
           {
               //The value does not set on the first assigment!
               HorizontalScroll.Value += distX;
               //so I add another one!?
               HorizontalScroll.Value += distX;
           }
       }




Why does it do this strange behaviour?
AnswerRe: Strange windows forms control bug? Pin
simplefolk25-Aug-11 3:45
simplefolk25-Aug-11 3:45 
Questionthread safety Pin
CodingYoshi24-Aug-11 11:52
CodingYoshi24-Aug-11 11:52 
AnswerRe: thread safety Pin
SledgeHammer0124-Aug-11 12:10
SledgeHammer0124-Aug-11 12:10 
GeneralRe: thread safety Pin
CodingYoshi24-Aug-11 16:24
CodingYoshi24-Aug-11 16:24 
AnswerRe: thread safety PinPopular
Luc Pattyn24-Aug-11 12:10
sitebuilderLuc Pattyn24-Aug-11 12:10 
GeneralRe: thread safety Pin
AspDotNetDev24-Aug-11 12:18
protectorAspDotNetDev24-Aug-11 12:18 
GeneralRe: thread safety Pin
CodingYoshi24-Aug-11 16:44
CodingYoshi24-Aug-11 16:44 
GeneralRe: thread safety PinPopular
Luc Pattyn24-Aug-11 17:16
sitebuilderLuc Pattyn24-Aug-11 17:16 
GeneralRe: thread safety Pin
CodingYoshi25-Aug-11 3:28
CodingYoshi25-Aug-11 3:28 
AnswerRe: thread safety Pin
Luc Pattyn25-Aug-11 3:38
sitebuilderLuc Pattyn25-Aug-11 3:38 
AnswerRe: thread safety Pin
AspDotNetDev24-Aug-11 12:17
protectorAspDotNetDev24-Aug-11 12:17 
AnswerRe: thread safety Pin
PIEBALDconsult24-Aug-11 17:42
mvePIEBALDconsult24-Aug-11 17:42 
AnswerRe: thread safety Pin
jschell25-Aug-11 8:41
jschell25-Aug-11 8:41 
GeneralRe: thread safety Pin
CodingYoshi25-Aug-11 15:01
CodingYoshi25-Aug-11 15:01 
GeneralRe: thread safety Pin
jschell26-Aug-11 8:28
jschell26-Aug-11 8:28 
QuestionWhat is the best way to make application Multi Language ? Pin
Honeyboy_2024-Aug-11 11:15
Honeyboy_2024-Aug-11 11:15 
JokeRe: What is the best way to make application Multi Language ? Pin
PIEBALDconsult24-Aug-11 14:56
mvePIEBALDconsult24-Aug-11 14:56 

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.