Click here to Skip to main content
16,007,885 members
Home / Discussions / C#
   

C#

 
GeneralRe: AllowDrop Property Problem Pin
Volker Jacobsen27-Oct-03 20:46
Volker Jacobsen27-Oct-03 20:46 
GeneralTwo ImageList and two ImageIndex (and maybe... useful source code for you) Pin
god4k27-Oct-03 1:36
god4k27-Oct-03 1:36 
GeneralRe: Two ImageList and two ImageIndex (and maybe... useful source code for you) Pin
Heath Stewart27-Oct-03 2:37
protectorHeath Stewart27-Oct-03 2:37 
QuestionHow do I catch Windows messages in c#?? Pin
IrishSonic27-Oct-03 0:03
IrishSonic27-Oct-03 0:03 
AnswerRe: How do I catch Windows messages in c#?? Pin
Heath Stewart27-Oct-03 2:13
protectorHeath Stewart27-Oct-03 2:13 
AnswerRe: How do I catch Windows messages in c#?? Pin
oOomen27-Oct-03 4:58
oOomen27-Oct-03 4:58 
GeneralFOCUS Pin
oOomen26-Oct-03 20:27
oOomen26-Oct-03 20:27 
GeneralRe: FOCUS Pin
Heath Stewart27-Oct-03 2:25
protectorHeath Stewart27-Oct-03 2:25 
This is the C# forum and, therefore, for .NET programming. Forget Windows messages when possible. Use the GotFocus event and set the focus to something else (you can't cancel it this way). If you just want to cancel focus, you can derive from Button and do several things, like call the protected method SetStyle such as:
public class MyButton : Button
{
  public MyButton()
  {
    this.SetStyle(ControlStyles.Selectable, false);
  }
  // ...
}
You could also override CreateParams and use a redefined BS_NOTIFY to remove that style from the button:
public class MyButton : Button
{
  private const int BS_NOTIFY = 0x4000;
  public MyButton()
  {
  }
  protected override CreateParams CreateParams
  {
    get
    {
        System.Windows.Forms.CreateParams cp = base.CreateParams;
        cb.Style &= ~BS_NOTIFY;
        return cb;
    }
  }
  // ...
}


 

-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
GeneralRe: FOCUS Pin
oOomen27-Oct-03 5:01
oOomen27-Oct-03 5:01 
GeneralRe: FOCUS Pin
allancto27-Oct-03 18:32
allancto27-Oct-03 18:32 
GeneralRe: FOCUS Pin
oOomen28-Oct-03 2:38
oOomen28-Oct-03 2:38 
GeneralRe: FOCUS Pin
oOomen28-Oct-03 2:52
oOomen28-Oct-03 2:52 
GeneralRe: FOCUS Pin
Heath Stewart28-Oct-03 2:54
protectorHeath Stewart28-Oct-03 2:54 
GeneralRe: FOCUS Pin
oOomen28-Oct-03 2:58
oOomen28-Oct-03 2:58 
QuestionHow to display store procedure list in Ms Access? Pin
god4k26-Oct-03 14:17
god4k26-Oct-03 14:17 
AnswerRe: How to display store procedure list in Ms Access? Pin
Heath Stewart26-Oct-03 17:17
protectorHeath Stewart26-Oct-03 17:17 
GeneralRe: There is stored procedure in MS Access Pin
Edbert P27-Oct-03 12:08
Edbert P27-Oct-03 12:08 
QuestionI have two Button, How to alter them? Pin
god4k26-Oct-03 14:16
god4k26-Oct-03 14:16 
AnswerRe: I have two Button, How to alter them? Pin
Christian Graus26-Oct-03 15:08
protectorChristian Graus26-Oct-03 15:08 
AnswerRe: I have two Button, How to alter them? Pin
Heath Stewart26-Oct-03 17:25
protectorHeath Stewart26-Oct-03 17:25 
Generallistviewitem Pin
jphuphilly26-Oct-03 13:28
jphuphilly26-Oct-03 13:28 
GeneralSMTP Pin
totig26-Oct-03 12:57
totig26-Oct-03 12:57 
GeneralRe: SMTP Pin
Heath Stewart26-Oct-03 17:13
protectorHeath Stewart26-Oct-03 17:13 
GeneralRe: SMTP Pin
totig27-Oct-03 0:59
totig27-Oct-03 0:59 
GeneralRe: SMTP Pin
Heath Stewart27-Oct-03 2:09
protectorHeath Stewart27-Oct-03 2:09 

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.