Click here to Skip to main content
15,919,132 members
Home / Discussions / C#
   

C#

 
GeneralRe: TextBox Pin
Malcolm Smart11-Sep-07 20:55
Malcolm Smart11-Sep-07 20:55 
Questionadding data trough datagridview to the sqlserver database Pin
NewToAspDotNet11-Sep-07 10:06
NewToAspDotNet11-Sep-07 10:06 
AnswerRe: adding data trough datagridview to the sqlserver database Pin
ss.mmm11-Sep-07 10:54
ss.mmm11-Sep-07 10:54 
AnswerRe: adding data trough datagridview to the sqlserver database Pin
Mairaaj Khan11-Sep-07 12:44
professionalMairaaj Khan11-Sep-07 12:44 
Questionhow to get proj file Pin
ss.mmm11-Sep-07 10:01
ss.mmm11-Sep-07 10:01 
AnswerRe: how to get proj file Pin
Judah Gabriel Himango11-Sep-07 10:13
sponsorJudah Gabriel Himango11-Sep-07 10:13 
GeneralRe: how to get proj file Pin
ss.mmm11-Sep-07 10:50
ss.mmm11-Sep-07 10:50 
Questioncustom combobox display issue Pin
arevans11-Sep-07 9:09
arevans11-Sep-07 9:09 
I built a custom control 'ChooseBox' that inherits from ComboBox. When I select an item from a choosebox control, the text in the textbox cannot be seen because of the blue selected text color. If I click away, the selected text is there. I can't see anything wrong with my code. I know this is probably a simple q. Here is the code. Can anybody help?

arevans

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using UtilityCode;

namespace WindowsControlLibrary
{
public class ChooseBox : ComboBox
{
public ChooseBox()
{
this.CausesValidation = true;
this.GotFocus += new EventHandler(ChooseBox_GotFocus);
this.LostFocus += new EventHandler(ChooseBox_LostFocus);
this.DropDown += new EventHandler(ChooseBox_DropDown);
this.Font = new Font("Andale Mono", 11F, FontStyle.Regular);
} // constructor

void ChooseBox_GotFocus(object sender, EventArgs e)
{
this.BackColor = Color.Yellow;
this.Font = new Font(this.Font, FontStyle.Bold);
} // method: GotFocus

void ChooseBox_LostFocus(object sender, EventArgs e)
{
this.BackColor = Color.White;
this.Font = new Font(this.Font, FontStyle.Regular);
} // method: LostFocus

protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
bool retValue = base.ProcessCmdKey(ref msg, keyData);
const int WM_KEYDOWN = 0x100;
const int WM_SYSKEYDOWN = 0x104;
if ((msg.Msg == WM_KEYDOWN) || (msg.Msg == WM_SYSKEYDOWN))
{
switch (keyData)
{
case Keys.Down:
SendKeys.Send("{TAB}");
retValue = true;
break;

case Keys.Up:
SendKeys.Send("+{TAB}");
retValue = true;
break;

case Keys.Enter:
SendKeys.Send("{TAB}");
retValue = true; // setting retValue =true here prevents a beep
break;
}
return retValue;
} // method: ProcessCmdKey

void ChooseBox_DropDown(object sender, EventArgs e)
{
this.BackColor = Color.White;
this.Font = new Font(this.Font, FontStyle.Regular);
}
}
}


AnswerRe: custom combobox display issue Pin
Skippums11-Sep-07 11:28
Skippums11-Sep-07 11:28 
QuestionDefaultValue Attribute for System.Collections.ArrayList Pin
Christopher Stratmann11-Sep-07 8:24
Christopher Stratmann11-Sep-07 8:24 
AnswerRe: DefaultValue Attribute for System.Collections.ArrayList Pin
Judah Gabriel Himango11-Sep-07 10:10
sponsorJudah Gabriel Himango11-Sep-07 10:10 
GeneralRe: DefaultValue Attribute for System.Collections.ArrayList Pin
Christopher Stratmann12-Sep-07 1:43
Christopher Stratmann12-Sep-07 1:43 
QuestionClear ButtonClick event Pin
SamuelClay11-Sep-07 7:41
SamuelClay11-Sep-07 7:41 
AnswerRe: Clear ButtonClick event Pin
Kristian Sixhøj11-Sep-07 7:50
Kristian Sixhøj11-Sep-07 7:50 
AnswerRe: Clear ButtonClick event Pin
Christian Graus11-Sep-07 8:03
protectorChristian Graus11-Sep-07 8:03 
GeneralRe: Clear ButtonClick event Pin
SamuelClay11-Sep-07 8:25
SamuelClay11-Sep-07 8:25 
AnswerRe: Clear ButtonClick event Pin
Brent Lamborn12-Sep-07 3:21
Brent Lamborn12-Sep-07 3:21 
QuestionError : Not All Code Paths Return A Value Pin
ctrlnick11-Sep-07 6:50
ctrlnick11-Sep-07 6:50 
AnswerRe: Error : Not All Code Paths Return A Value Pin
Patrick Etc.11-Sep-07 6:53
Patrick Etc.11-Sep-07 6:53 
AnswerRe: Error : Not All Code Paths Return A Value Pin
Christian Graus11-Sep-07 7:00
protectorChristian Graus11-Sep-07 7:00 
QuestionDifferentiate :User accessing form internet and user accessing from with the organization Pin
ss.mmm11-Sep-07 6:40
ss.mmm11-Sep-07 6:40 
AnswerRe: Differentiate :User accessing form internet and user accessing from with the organization Pin
Giorgi Dalakishvili11-Sep-07 6:47
mentorGiorgi Dalakishvili11-Sep-07 6:47 
QuestionHow to call ButtonClick event? Pin
ss.mmm11-Sep-07 6:38
ss.mmm11-Sep-07 6:38 
AnswerRe: How to call ButtonClick event? Pin
Christian Graus11-Sep-07 6:47
protectorChristian Graus11-Sep-07 6:47 
AnswerRe: How to call ButtonClick event? Pin
Giorgi Dalakishvili11-Sep-07 6:56
mentorGiorgi Dalakishvili11-Sep-07 6: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.