C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[14637] Re:콤보 박스가 나타납니다..근데..이번에는 셀을 이동하면 같이 이동하질 않네요..
시후 [] 821 읽음    2002-01-17 11:59
변수를 수정했습니다..나타나긴 하는데..셀을 이동시키면 같이 이동해서 나타나야 하는데..
첫번째 ACol = 4, ARow = 0 에만 나타나고 이동하질 않아요..어케된건지 몰것네..

#include <vcl.h>
: #pragma hdrstop
:
: #include "Unit1.h"
: //---------------------------------------------------------------------------
: #pragma package(smart_init)
: #pragma resource "*.dfm"
: TForm1 *Form1;
: int StartX, StartY;
: //---------------------------------------------------------------------------
: __fastcall TForm1::TForm1(TComponent* Owner)
:         : TForm(Owner)
: {
: }
: //---------------------------------------------------------------------------
:
: void __fastcall TForm1::StringGrid1MouseDown(TObject *Sender, TMouseButton Button,
:       TShiftState Shift, int X, int Y)
: {
: StartX = X;
: StartY = Y;
: }
: //---------------------------------------------------------------------------
:
: void __fastcall TForm1::StringGrid1SelectCell(TObject *Sender, int ACol, int ARow,
:       bool &CanSelect)
: {
: int c, r;
: TRect t;
:
:      StringGrid1->MouseToCell( StartX, StartY, c, r);
:
:      if (r < 1) return;
:      c = 4;
:      ARow = r;
:      t = StringGrid1->CellRect(c, r);
:
:      ComboBox1->Left = StringGrid1->Left + t.Left+1;
:      ComboBox1->Top = StringGrid1->Top + t.Top+1;
:      ComboBox1->Width = (t.Right - t.Left)+3;
:      ComboBox1->Visible = true;
: }
: //---------------------------------------------------------------------------
:



시후 님이 쓰신 글 :
:
: #include <vcl.h>
: #pragma hdrstop
:
: #include "Unit1.h"
: //---------------------------------------------------------------------------
: #pragma package(smart_init)
: #pragma resource "*.dfm"
: TForm1 *Form1;
: int X, Y;
: //---------------------------------------------------------------------------
: __fastcall TForm1::TForm1(TComponent* Owner)
:         : TForm(Owner)
: {
: }
: //---------------------------------------------------------------------------
:
: void __fastcall TForm1::SG1MouseDown(TObject *Sender, TMouseButton Button,
:       TShiftState Shift, int X, int Y)
: {
: X, Y;
: }
: //---------------------------------------------------------------------------
:
: void __fastcall TForm1::SG1SelectCell(TObject *Sender, int ACol, int ARow,
:       bool &CanSelect)
: {
: int c, r;
: TRect t;
:
:      SG1->MouseToCell( X, Y, c, r);
:
:      if (r<1) return;
:      c=4;
:      ARow = r;
:      t = SG1->CellRect(c, r);
:
:      ComboBox1->Left = SG1->Left + t.Left+1;
:      ComboBox1->Top = SG1->Top + t.Top+1;
:      ComboBox1->Width = (t.Right - t.Left)+3;
:      ComboBox1->Visible = true;
: }
: //---------------------------------------------------------------------------
:
: Q&A 에서 찾은걸 응용해봤거든요..그냥 갔다가 붙여봤어요..사실 개념은 잘 몰겠구요.
:
: 자세한 설명좀 부탁드립니다..책을 뒤저 봤는데..이런 이벤트 처리에 대해서는 잘 안나오더라구요..
:
: 고수님들 오늘도 부탁드립니다..꾸벅
:
:
:

+ -

관련 글 리스트
14631 스트링그리드 셀 안에 콤보 박스를 넣는 걸 Q&A 뒤져서 비슷한 걸 찾았거든요..안되요.. 시후 886 2002/01/17
14637     Re:콤보 박스가 나타납니다..근데..이번에는 셀을 이동하면 같이 이동하질 않네요.. 시후 821 2002/01/17
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.