검색
다른 검색어로 검색을 시도하시기 바랍니다.
[Flex] Datagrid / Arraycollection addItem(At)
Flex에서 Datagrid와 Arraycollection에 원하는 항목을 추가하기 위해서는 다음과 같은 명령어를 사용한다.
단순히 맨 나중 항목으로 추가할 경우는 다음과 같이 사용한다.
Array1.addItem ({ Data-field : 'Value'});
Grid1.dataProvider.addItem({ Data-field : 'Value});
하지만 위치를 지정해서 넣고 싶은 경우 아래와 같이 사용하면 된다.
Array1.addItemAt ({ Data-field : 'Value'}, 위치);
Grid1.dataProvider.addItemAt ({ Data-field : 'Value'}, 위치);
예를 들면 다음과 같은 구문이 될 것이다.
ex) GridArray.addItemAt ({ Title : 'Testing', Contents : 'addItem Test ex'}, 1)
위와 같은 경우 GridArray의 1번째 순서에 Title과 Contents라는 항목에 'Testing', 'addItem Test ex'라는 내용이 추가되었다.
이미 존재하는 Array에도 새로운 Data-field를 추가할 수 있다.
'Programming > Java / Flex' 카테고리의 다른 글
[Flex] Popup창에서 부모창으로 데이터 호출하기 (0) | 2013.11.27 |
---|---|
[Eclipse] 단축키 (0) | 2013.05.28 |
PowerJava [2판] Theory Chaper 06 반복문 (0) | 2013.01.29 |
PowerJava [2판] Theory Chaper 06 조건문 (0) | 2013.01.29 |
PowerJava [2판] Theory Chaper 01~05 (0) | 2013.01.28 |
[SQL] Parametert(변수) 입력시 변수형태 주의점 (spring/mybatis)
spring/mybatis에서 sql 사용시 주의점
'Programming > SQL' 카테고리의 다른 글
CLOB 구문 검색방법 (0) | 2015.02.19 |
---|---|
Table 권한 주기 (0) | 2015.01.08 |
[Oracle] 숫자관련 함수 (0) | 2013.11.27 |
[SQL] Data Type (Char) (0) | 2013.04.12 |
[Oracle] Table Column의 추가 / 변경 / 삭제 (0) | 2013.04.09 |
DropDownButton
RadDropDownButton provides a menu-like interface open from a button.
RadDropDownButton의 각 항목을 클릭 할 때 작업을 실행하도록 설정할 수있다. 또한 아이템을 사용하면 하위 항목의 요구에 맞는 모든 계층을 만들 수 있고 다른 항목을 포함 할 수 있습니다.
RadDropDownButton는 RadSplitbutton 과 시각적으로 차이가 없지만, 프로그램상 차이가 있습니다. RadSplitbutton 의해 위 DefaultItem 속성은 해당 Click 이벤트 버튼을 클릭 할 때 트리거 될 품목입니다. 당신이 선택 메뉴에서 만들 때와 마찬가지로 클릭하면 무언가를 버튼하려면 대신 RadDropDownButton의 RadSplitbutton 의해 사용해야합니다.
The heart of RadDropDownButton is the Items collection. This collection defines the menu items that appear when the RadDropDownButton is clicked. To get started, drag a RadDropDownButton on the surface of your form from the Toolbox. There are two ways to add items to your new button.
Adding Items at Design Time
To add menu items at Design Time, click on the Items property(the ellipsis button) to launch the RadElement Collection Editor. Click the arrow next to the Add button to add items to the menu. You can add a variety of items to the collection.
Once you have added a RadMenuItem to the collection, it will appear in the list on the left side of the dialog. Click the RadMenuItem to edit its properties in the corresponding property grid on the right of the dialog.
In the property grid you will find many of the standard control properties, including Text, to control the display text of the item and ToolTipText that displays when the mouse hovers over an item. Each RadMenuItem you add also contains an Items collection of its own, allowing you to create menu hierarchies in the RadDropDownButton. You can also do the following with each item:
- Associate an image to an item using the Image property or associate a standard ImageList component to the RadDropDownButton and use the ImageIndex or ImageKey properties for the item.
- PopupDirection determines the direction in which the sub items of a RadMenuItem will be displayed and can be Left, Right, Up or Down.
- To display sub items in two columns set HasTwoColumns to true and add items to the RightColumnItems collection.
- Use CheckOnClick to toggle a check mark next to a RadMenuItem. This property is appropriate to use when the item doesn't contain sub items.
Adding Items at Run Time in Code
You can also add RadDropDownButton items in code at Run Time. The following example code illustrates how to programmatically add a RadMenuItem to your button.
[C#] Adding RadDropDownButton items
void Form1_Load(object sender, EventArgs e) { RadMenuItem myRadMenuItem = new RadMenuItem(); myRadMenuItem.Text = "My New Item"; radDropDownButton1.Items.Add(myRadMenuItem); myRadMenuItem.Click += new EventHandler(myRadMenuItem_Click); } void myRadMenuItem_Click(object sender, EventArgs e) { MessageBox.Show((sender as Telerik.WinControls.UI.RadMenuItem).Text + " was clicked."); }
[C#] Adding sub items
using Telerik.WinControls.UI; namespace RadDropDownButtonDemo { public partial class Form1 : Form { private void Form1_Load(object sender, EventArgs e) { RadMenuItem mainItem = radDropDownButton1.Items[0] as RadMenuItem; RadMenuItem mySubMenuItem = new RadMenuItem(); mySubMenuItem.Text = "Submenu Item"; mySubMenuItem.Click += new EventHandler(mySubMenuItem_Click); mainItem.Items.Add(mySubMenuItem); } void mySubMenuItem_Click(object sender, EventArgs e) { MessageBox.Show((sender as RadMenuItem).Text + " was clicked."); } } }
[VB.NET] Adding RadDropDownButton items
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim myRadMenuItem As New RadMenuItem() myRadMenuItem.Text = "My New Item" radDropDownButton1.Items.Add(myRadMenuItem) AddHandler myRadMenuItem.Click, AddressOf myRadMenuItem_Click End Sub Sub myRadMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) MessageBox.Show((TryCast(sender, RadMenuItem)).Text + " was clicked.") End SubSimilarly, you can create item hierarchies in code by adding new RadMenuItem objects to the Items collection of your existing RadMenuItem.
[VB.NET] Adding sub items
Imports System.Windows.Forms Imports Telerik.WinControls.UI Namespace RadDropDownButtonDemo Public Class Form1 Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Dim mainItem As RadMenuItem = TryCast(radDropDownButton1.Items(0), RadMenuItem) Dim mySubMenuItem As New RadMenuItem() mySubMenuItem.Text = "Submenu Item" AddHandler mySubMenuItem.Click, AddressOf mySubMenuItem_Click mainItem.Items.Add(mySubMenuItem) End Sub Sub mySubMenuItem_Click(ByVal sender As Object, ByVal e As EventArgs) MessageBox.Show((TryCast(sender, RadMenuItem)).Text + " was clicked.") End Sub End Class End Namespace
Using Click Events
To handle the Click event of individual RadMenuItems on the drop down menu at Design Time, locate the RadMenuItem in the drop down list in the Properties window of the Windows Form designer. Click the events button, then double-click the Click event to generate an event handler. Then fill in your event-handling code.
'Programming > RadControl for WINFORMS' 카테고리의 다른 글
RadButton (0) | 2013.04.22 |
---|
RadButton
- RadButton은 기본 Winforms 버튼을 대체하며, 테마를 지원합니다.
- RadButton을 폼에 드래그하여 추가합니다.
코딩을 이용하여 버튼을 추가하는경우는 아래의 소스를 참조하세요
[C#]에서 RadButton 추가
RadButton myNewRadButton = new RadButton(); myNewRadButton.Text = "My New RadButton"; myNewRadButton.Width = 150; myNewRadButton.Height = 50; this.Controls.Add(myNewRadButton);
Dim myNewRadButton As New RadButton()
myNewRadButton.Text = "My New RadButton"
myNewRadButton.Width = 150
myNewRadButton.Height = 50
Me.Controls.Add(myNewRadButton)
또한 버튼안에 들어가는 텍스트는 HTML 태그를 이용할수 있으며, 지원하는 태그는 다음과 같습니다.
<font> | N/A |
폰트 설정 |
<color> | N/A | 글자 색. |
<size> | N/A | 글자크기. |
<b> | </b> | 굵게. |
<i> | </i> | 기울임꼴. |
<u> | </u> |
텍스트 밑줄 |
<br> | N/A |
줄바꿈. |
다음은 예제 코드입니다.
[C#]
this.radButton1.Text = "This is RadLabel
Arial, Bold
Times, Italic Underline
Size = 9
Sample Text";
Me.radButton1.Text = "This is RadLabel
Arial, BoldTimes, Italic Underline Size = 9 Sample Text"
'Programming > RadControl for WINFORMS' 카테고리의 다른 글
DropDownButton (0) | 2013.04.22 |
---|
[SQL] Data Type (Char)
이번에는 Data type 중에 Char에 대하여 알아보겠다.
Char는 고정된 크기의 문자열을 나타내는 Data Type이다. 예를 들어 Varchar(10)은 '3'으로 입력이 된다면, Char(10)은 '3 '로 모두 10byte로 입력이 된다.
이는 Query문에서 적용할때 문제가 될 수 있다. 먼저 호출되어 Grid나 Textbox에 입력이 된 자료를 다시 string으로 불러오면 '3'으로 읽혀오는 경우가 있다. 이런 경우 where절에 조건을 걸었을때 제대로 된 비교가 이루어지지 않아 해당 Query가 수행되지 않는다. 이런 경우에는 Char type의 변수에 Trim을 사용하여 비교해줘야 한다.
ex : Trim(<Column>)
Y/N 같은 Boolean type의 Data를 저장할 것이 아니라면 Char type을 지양할 것을 권한다. 또한 최근에는 Varchar보다 Nvarchar를 더 많이 사용하는 추세이다. 이유는 검색해보시면 알겠지만, Nvarchar가 더 많은 Data를 담을 수 있기 때문이다.
'Programming > SQL' 카테고리의 다른 글
CLOB 구문 검색방법 (0) | 2015.02.19 |
---|---|
Table 권한 주기 (0) | 2015.01.08 |
[Oracle] 숫자관련 함수 (0) | 2013.11.27 |
[SQL] Parametert(변수) 입력시 변수형태 주의점 (spring/mybatis) (0) | 2013.05.05 |
[Oracle] Table Column의 추가 / 변경 / 삭제 (0) | 2013.04.09 |
[Oracle] Table Column의 추가 / 변경 / 삭제
Table Column 관련 명령어들 (Oracle)
해당 테이블에 컬럼을 추가
ALTER TABLE <Table Name>
ADD <Column> <Column Type (Length)>
해당 테이블의 컬럼의 타입을 변경
ALTER TABLE <Table Name>
MODIFY (<Column> <Column Type(Length)>)
해당 테이블의 컬럼의 이름을 변경
ALTER TABLE <Table Name>
RENAME COLUMN <Befor Column Name> to <After Column Name>
해당 테이블의 선택한 컬럼을 삭제
ALTER TABLE <Table Name>
DROP COLUMN <Column Name>
위 내용은 Oracle에서만 적용되며, Mysql / MSsql에서는 다를 수 있습니다.
위 명령어를 이용하여 테이블의 컬럼을 추가 / 변경 / 삭제할 수 있을 뿐 아니라 GDB에서도 필드를 추가 / 변경 / 삭제하는데 사용할 수 있다.
'Programming > SQL' 카테고리의 다른 글
CLOB 구문 검색방법 (0) | 2015.02.19 |
---|---|
Table 권한 주기 (0) | 2015.01.08 |
[Oracle] 숫자관련 함수 (0) | 2013.11.27 |
[SQL] Parametert(변수) 입력시 변수형태 주의점 (spring/mybatis) (0) | 2013.05.05 |
[SQL] Data Type (Char) (0) | 2013.04.12 |
당신이 학생이라면? 무료로 Visual Studio 다운로드 받기
안녕하세요!
오늘은 열심히 공부하고 계신 학생들을 위한 Microsoft Visual Studio 다운로드 방법을 소개하려고 합니다.
Microsoft 는 후진양성에 힘을쓰고 있는지,
학생들에게 Visual Studio를 무료로 제공하고 있는데요,
정말 후덜덜한 가격에 구매하기 뭐하고.. 어둠의 경로를 찾아 헤매고 있는 학생이라면
놓치지 마시길 바랍니다.
해당되는곳은 바로
드림스파크 입니다
이곳이 바로 드림스파크 인데요!
당신이 학생임을 증명할수 있는 방법은 간단합니다!
바로 이메일 주소입니다.
아마 대학생이시라면, 학교에서 발급해준 이메일 주소가 있을것입니다.
저같은 경우 건국대학교이니깐 excretions@konkuk.ac.kr
이런식으로 메일주소 뒤에 ac.kr 이 붙어있지요!
바로 이 이메일주소로 인증코드를 받아 가입하는 형식으로, 학생임을 증명하는데요
혹시라도 학교를 졸업하셨더라도, 메일계정이 휴먼상태로 남아있을지 모르니 확인해보시는게 좋을것 같습니다!
화면 상단에 보시면 학생이라고 써있는 부분이 있습니다! 눌러주시구요
아래 부분에 계정만들기 부분을 클릭해줍니다!
계정만들기 부분은, 제가 이미 가입을 한 상태라 스샷을 찍을수가 없네요 ㅜㅜ
학교를 인증하고, 메일이 발송되면 인증코드를 입력하고 가입이 완료됩니다!
가입이 완료된후 메인페이지에 보시면,
제품 다운로드 밑에 『자세한정보』를 클릭하여 다운로드 목록으로 가실수 있습니다!
현재, 다운로드 받을수 있는 목록을 보자면 아래처럼 나오네요
원하는 것을 다운로드 받으면 되겠습니다!
한가지 주의하실점은, 다운로드시 SDC 라는 패키지 형태로 다운로드 할수 있는데,
컴퓨터에 넷프레임워크 2.0 이상이 깔려있어야
다운로드후 자동으로 패키지를 해체해 줍시다!
다운로드 후, SDC파일만 덩그러니 받고 구글링 하지마시구
꼭! 넷프레임워크 깔려있는지 확인해보시기 바랍니다!
이상 포스팅을 마치겠습니다
'Programming > VB.NET' 카테고리의 다른 글
PC방용 정산관리 제작일지 - 02 [MYSQL 연결] (0) | 2013.01.31 |
---|---|
PC방용 정산관리 제작일지 - 01 (0) | 2013.01.27 |
PC방용 정산관리 제작일지 - 02 [MYSQL 연결]
MYSQL 과 VB.NET을 연결하는 방법은 여러가지가 있다.
필자는 그중에서도 MysqlClient 라는 방식을 사용하려고 한다.
이파일을 다운로드 받고, 참조추가 해준뒤
프로젝트 속성 - 참조 에 들어가서
그림과 같이 로컬 복사를 True 로 설정해둔다.
이렇게 바꿔주면 컴파일 할때마다 EXE와 같은 경로에 저 파일도 같이 복사를 해준다.
MYSQL을 연결하기 위해선 서버주소, ID등 연결문자열을 써야하는데
이것을 프로그램내에 지정해버린다면 혹시라도 변동사항이 있을경우
프로그램을 수정해야 되는 번거러움이 있다.
그래서, 필자는 app.cfg 라는 파일을 만들고,
그 안에 연결에 필요한 정보를 넣어두었다.
app.cfg 파일의 내용은 다음과 같다
SERVER=61.42.232.124; DATABASE=XENO; UID=root; PWD=apmsetup; OPTION=35; STMT=set names euckr
필자는 프로그램을 구동할 sub main 과
각종 전역변수등을 선언하기위해
Program.vb 라는 새로운 모듈을 생성하였다.
'Programming > VB.NET' 카테고리의 다른 글
당신이 학생이라면? 무료로 Visual Studio 다운로드 받기 (0) | 2013.01.31 |
---|---|
PC방용 정산관리 제작일지 - 01 (0) | 2013.01.27 |
PowerJava [2판] Theory Chaper 06 반복문
▣ while문
public class Ch6_Ex { public static void main (String[] args) { int i = 0 ; while ( i < 10 ) { System.out.println(" i의 값은 " + i) ; i ++ ; } } }
while문은 루프구조의 상단에 조건식이 존재하므로 조건을 만족하면 내부 로직이 한번도 실행되지 않을 수 있다.
▣ do-while문
public class Ch6_Ex { public static void main (String[] args) { int i = 10 ; do { System.out.println(" i의 값은 " + i) ; i ++ ; } while ( i < 10 ) ; } }
do-while문은 루프구조의 하단에 조건식이 존재하므로 조건을 만족하더라도 내부 로직이 한번은 실행된다.
▣ do-while문
public class Ch6_Ex { public static void main (String[] args) { for ( int i = 0; i < 10; i++ ) { System.out.println(" i의 값은 " + i) ; } } }
for문은 설정된 조건식과 증감식에 의한 횟수만큼 내부 로직이 실행된다.
▣ break
import java.util.* ; public class Ch6_Ex { public static void main (String[] args) { int i = 0 ; int total = 0 ; int counting = 0 ; int cost = 0 ; Scanner scan = new Scanner(System.in) ; while ( true ) { System.out.println(" 금액을 입력하시오 : ") ; int cost = scan.nextInt() ; if ( cost < 100 ) break ; total += cost ; counting++ ; } System.out.println( "평균금액은 " + total / counting + "원입니다." } }
break문은 해당 루프문을 종료시킨다.
check_loop : while ( true ) { while (true) { if ( cost < 100 ) break check_loop ; } }
중첩 루프문에 레이블을 부여하여 break문을 사용하는 경우 그 레이블에 해당하는 중첩 루프문을 모두 종료시킨다.
▣ continue
public class Ch6_Ex { public static void main (String[] args) { int counting = 0 ; for ( int i = 0; i < 10; i++ ) { if ( i % 2 = 0 ) continue ; counting++ ; } System.out.println("2의 배수의 갯수는 " + counting + "개입니다.") ; } }
if문 안의 조건을 만족할는 경우에만 전체 for문을 루프하며, 만족하지 않는 경우 다시 for문 상단으로 돌아가 로직을 반복한다.
'Programming > Java / Flex' 카테고리의 다른 글
[Flex] Popup창에서 부모창으로 데이터 호출하기 (0) | 2013.11.27 |
---|---|
[Eclipse] 단축키 (0) | 2013.05.28 |
[Flex] Datagrid / Arraycollection addItem(At) (0) | 2013.05.05 |
PowerJava [2판] Theory Chaper 06 조건문 (0) | 2013.01.29 |
PowerJava [2판] Theory Chaper 01~05 (0) | 2013.01.28 |
PowerJava [2판] Theory Chaper 06 조건문
Chapter 06 조건과 반복
▣ if 문
public class Ch6_Ex {
public static void main (String[] args) {
if (age >= 20)
System.out.println("미성년이 아닙니다.");
}
public class Ch6_Ex { public static void main (String[] args) { if (age >= 20) { System.out.println("미성년이 아닙니다."); System.out.println("출입이 가능합니다."); } else { System.out.println("미성년자 입니다."); System.out.println("출입이 불가능합니다."); } }
▣ 조건 연산자
public class Ch6_Ex {
public static void main (String[] args) {
System.out.println(age >= 20 ? "미성년이 아닙니다." : "미성년자 입니다.");
}
▣ 연속적인 if문
public class Ch6_Ex {
public static void main (String[] args) {
if (age >= 20)
System.out.println("성인 입니다.");
else
if (age >= 17)
System.out.println("고등학생입니다.");
else
if (age >= 14)
System.out.println("중학생입니다.");
else
System.out.println("초등학생입니다.");
}
public class Ch6_Ex {
public static void main (String[] args) {
if (age >= 20)
System.out.println("성인 입니다.");
else if (age >= 17)
System.out.println("고등학생입니다.");
else if (age >= 14)
System.out.println("중학생입니다.");
else
System.out.println("초등학생입니다.");
}
▣ switch문
public class Ch6_Ex {
public static void main (String[] args) {
int number;
switch (number) {
case 1 :
System.out.println("1학년 입니다.");
case 2 :
System.out.println("2학년 입니다.");
case 3 :
System.out.println("3학년 입니다.");
case 4 :
System.out.println("4학년 입니다.");
default :
System.out.println("예비대학생 입니다.");
}
'Programming > Java / Flex' 카테고리의 다른 글
[Flex] Popup창에서 부모창으로 데이터 호출하기 (0) | 2013.11.27 |
---|---|
[Eclipse] 단축키 (0) | 2013.05.28 |
[Flex] Datagrid / Arraycollection addItem(At) (0) | 2013.05.05 |
PowerJava [2판] Theory Chaper 06 반복문 (0) | 2013.01.29 |
PowerJava [2판] Theory Chaper 01~05 (0) | 2013.01.28 |