WinForms윈폼 FpSpread ButtonCellType Hover 시에 원하는 색으로 변경 가능할까요?
추천0 비추천 0
페이지 정보
작성자 편도준 작성일 2022-11-02 09:17 조회 1,140회 댓글 0건제품 버전 : Spread.NET_V12_12.0.20193.0
컨트롤 이름 : VisualStyleElement
본문
관련링크
안녕하세요 항상 제품 유용하게 사용하고 있습니다.
spread 사용 중 궁금한 점이 생겨 일전에 질문글을 남긴 적이 있습니다.
사용 중 질문할 사항이 추가로 생겨 질문드립니다.
private void Form1_Load( object sender, EventArgs e) { HoverButtonCellType buttonCt = new HoverButtonCellType(); fpSpread1.ActiveSheet.Cells[2, 2].CellType = buttonCt; } public class HoverButtonCellType : FarPoint.Win.Spread.CellType.ButtonCellType { public override void PaintCell(Graphics g, Rectangle r, FarPoint.Win.Spread.Appearance appearance, object value, bool isSelected, bool isLocked, float zoomFactor) { if (appearance.MouseOver) { System.Windows.Forms.VisualStyles.VisualStyleElement element = System.Windows.Forms.VisualStyles.VisualStyleElement.Button.PushButton.Hot; if (System.Windows.Forms.VisualStyles.VisualStyleRenderer.IsElementDefined(element)) { FarPoint.Win.FpVisualStyleRenderer vsr = new FarPoint.Win.FpVisualStyleRenderer(element); vsr.DrawBackground(g, r); return ; } } base .PaintCell(g, r, appearance, value, isSelected, isLocked, zoomFactor); } } |
지난번에 해당 코드로 fpSpread의 셀타입을 버튼으로 변경 후 MouseHover 시에 Focus되는 방법을 도움 받았습니다.
혹시 추가로 마우스를 버튼으로 올려놓았을 시에 버튼 색이나 버튼 안 폰트 색을 변경하고 싶은데 가능한지 여쭤봅니다.
항상 성실한 답변 감사합니다.
댓글목록
등록된 댓글이 없습니다.