도킹된 컨트롤의 순서변경
간혹 잊어버린다.
Ctrl+w,u 하면 문서개요 창이 나오는데
여기서 화살표로 컨트롤 위치를 아래위로 변경하면 원하는 위치로 이동.
2016년 6월 16일 목요일
2016년 3월 21일 월요일
c# WinForm Dock Order Change
c# winform으로 개발 중
1. panel위에 버턴을 배치하고
2. 버턴의 속성에서 Dock를 Right로 선택하면
해당 버턴은 가장 오른쪽으로 가서 철석 달라 붙습니다.
참 편리한 기능입니다.
3. 두번째 버턴도 Right속성을 주면 역시 오른쪽에 철석 달라 붙습니다.
참 편리합니다.
4. 첫번째 버턴의 왼쪽에 철석 달라 붙은 두번째 버턴을 가장 오른쪽으로 보내고 싶습니다.
잘 안됩니다.
참 불편합니다.
이럴때는
메뉴/보기/다른창/문서개요 를 열어보면

화면에 추가했던 리소스들이 나열되어 있다.
여기서 이동하고 싶은 리소스를 선택하여 드래그 하여 순서를 바꾸면
버턴의 위치가 바뀌어 있음을 볼 수 있다.
참조 http://stackoverflow.com/questions/154543/panel-dock-fill-ignoring-other-panel-dock-setting
1. panel위에 버턴을 배치하고
2. 버턴의 속성에서 Dock를 Right로 선택하면
해당 버턴은 가장 오른쪽으로 가서 철석 달라 붙습니다.
참 편리한 기능입니다.
3. 두번째 버턴도 Right속성을 주면 역시 오른쪽에 철석 달라 붙습니다.
참 편리합니다.
4. 첫번째 버턴의 왼쪽에 철석 달라 붙은 두번째 버턴을 가장 오른쪽으로 보내고 싶습니다.
잘 안됩니다.
참 불편합니다.
이럴때는
메뉴/보기/다른창/문서개요 를 열어보면
화면에 추가했던 리소스들이 나열되어 있다.
여기서 이동하고 싶은 리소스를 선택하여 드래그 하여 순서를 바꾸면
버턴의 위치가 바뀌어 있음을 볼 수 있다.
참조 http://stackoverflow.com/questions/154543/panel-dock-fill-ignoring-other-panel-dock-setting
2015년 8월 26일 수요일
C# WinForm ComboBox 함수
c# winform 에서 콤보박스는 종종 사용하게 되는데,
대부분의 경우 콤보박스는 DB에서 코드값을 넣어 사용합니다.(나의 경우)
이때마다 콤보박스을 채우는 함수를 다음과 같이 만들어 놓으면 편합니다.
public void BindCodeCombo(ComboBox cBox, string MajorCode)
{
try
{
MySqlConnection Con = new MySqlConnection(connectStr);
Con.Open();
MySqlCommand mcd = new MySqlCommand("select 코드, 코드이름 from code ", Con);
MySqlDataReader mdr = mcd.ExecuteReader();
Dictionary<string, string> comboSource = new Dictionary<string, string>();
while (mdr.Read())
{
comboSource.Add(mdr.GetString("코드"), mdr.GetString("코드이름"));
}
cBox.DisplayMember = "Value";
cBox.ValueMember = "Key";
cBox.DataSource = new BindingSource(comboSource, null);
Con.Close();
}
catch (Exception eM)
{
MessageBox.Show(".BindCodeCombo 실행중 오류가 발생하였습니다.\\n "
+ eM.Message.Replace("'", " ").ToString());
}
}
대부분의 경우 콤보박스는 DB에서 코드값을 넣어 사용합니다.(나의 경우)
이때마다 콤보박스을 채우는 함수를 다음과 같이 만들어 놓으면 편합니다.
public void BindCodeCombo(ComboBox cBox, string MajorCode)
{
try
{
MySqlConnection Con = new MySqlConnection(connectStr);
Con.Open();
MySqlCommand mcd = new MySqlCommand("select 코드, 코드이름 from code ", Con);
MySqlDataReader mdr = mcd.ExecuteReader();
Dictionary<string, string> comboSource = new Dictionary<string, string>();
while (mdr.Read())
{
comboSource.Add(mdr.GetString("코드"), mdr.GetString("코드이름"));
}
cBox.DisplayMember = "Value";
cBox.ValueMember = "Key";
cBox.DataSource = new BindingSource(comboSource, null);
Con.Close();
}
catch (Exception eM)
{
MessageBox.Show(".BindCodeCombo 실행중 오류가 발생하였습니다.\\n "
+ eM.Message.Replace("'", " ").ToString());
}
}
2015년 8월 25일 화요일
c# winform 전화번호
public string PhoneNumber(string pPhone)
{
string b = "";
if (pPhone.Length == 9)
b = pPhone.Substring(0, 2) + "-" + pPhone.Substring(2, 3) + "-" + pPhone.Substring(5, 4);
else if (pPhone.Length == 10)
{
if (pPhone.Substring(0, 2) == "02")
b = pPhone.Substring(0, 2) + "-" + pPhone.Substring(2, 4) + "-" + pPhone.Substring(6, 4);
else
b = pPhone.Substring(0, 3) + "-" + pPhone.Substring(3, 3) + "-" + pPhone.Substring(6, 4);
}
else if (pPhone.Length == 11)
b = pPhone.Substring(0, 3) + "-" + pPhone.Substring(3, 4) + "-" + pPhone.Substring(7, 4);
else if (pPhone.Length == 12)
b = pPhone.Substring(0, 4) + "-" + pPhone.Substring(4, 4) + "-" + pPhone.Substring(8, 4);
else
b = pPhone;
return b;
}
{
string b = "";
if (pPhone.Length == 9)
b = pPhone.Substring(0, 2) + "-" + pPhone.Substring(2, 3) + "-" + pPhone.Substring(5, 4);
else if (pPhone.Length == 10)
{
if (pPhone.Substring(0, 2) == "02")
b = pPhone.Substring(0, 2) + "-" + pPhone.Substring(2, 4) + "-" + pPhone.Substring(6, 4);
else
b = pPhone.Substring(0, 3) + "-" + pPhone.Substring(3, 3) + "-" + pPhone.Substring(6, 4);
}
else if (pPhone.Length == 11)
b = pPhone.Substring(0, 3) + "-" + pPhone.Substring(3, 4) + "-" + pPhone.Substring(7, 4);
else if (pPhone.Length == 12)
b = pPhone.Substring(0, 4) + "-" + pPhone.Substring(4, 4) + "-" + pPhone.Substring(8, 4);
else
b = pPhone;
return b;
}
피드 구독하기:
글 (Atom)
vsftpd FTP 서버 접속은 성공하였으나, "디렉토리 목록 조회 실패" 현상 발생시
FTP Passive 모드를 활성화 필요. 1. vsftpd 설정 변경 /etc/vsftpd/vsftpd.conf 상에 아래 내용 추가 기입 #passive modpasv_enable=YES pasv_min_port=5001 pasv...
-
from PIL import Image, ImageTk E : Unable to locate package python3 - pil E : Unable to locate package python3 - imaging - tk $sudo ...
-
FTP Passive 모드를 활성화 필요. 1. vsftpd 설정 변경 /etc/vsftpd/vsftpd.conf 상에 아래 내용 추가 기입 #passive modpasv_enable=YES pasv_min_port=5001 pasv...