메뉴 바로가기

서브메뉴 바로가기

본문 바로가기

logo

C# .NET 자료실

프린터 목록을 가져와서 콤보박스에 출력하는 예제


          foreach (string printer in PrinterSettings.InstalledPrinters)

          {

            this.cboPrinter.Items.Add(printer.ToString());



            PrinterSettings p = new PrinterSettings();

            p.PrinterName = printer;


            if (p.IsDefaultPrinter)

            {

              cboPrinter.Text = printer.ToString();

              DefaultPrintName = cboPrinter.Text;

            }

          }




기본프린터 변경 방법


      [DllImport("winspool.drv")]

      public static extern bool SetDefaultPrinter(string name);


 SetDefaultPrinter(cboPrinter.Text);   // cboPrinter.Text 는 기본프린터로 변경할 프린터명


    

관련 문서가 검색되었습니다.
  1. [2014/10/07] Activity 변경 by aaaa (1828)
  2. [2014/05/12] 스위치 입력 값 시리얼 모니터에 출력 by WhiteAT (4107)
  3. [2014/04/18] 0. LED 깜박이기 by WhiteAT (3114)
  4. [2014/04/17] 준비- 툴 설치,장치 추가 등 by WhiteAT (8939)
  5. [2013/11/29] c# 윈도우 폼 컨트롤 순서 by Question (12820) *1
  6. [2013/06/20] 배열 문제인데요 ㅠㅠ by Question (10800) *1
  7. [2013/02/01] OrCAD 란? by WhiteAT (8113)
  8. [2012/11/13] ZEO 모듈이란? by WhiteAT (6394)
  9. [2012/08/09] ZEO 모듈,매뉴얼,드라이버,라이브러리,관리툴 by WhiteAT (29071)
  10. [2012/06/08] C#, DateTimePicker 사용 by WhiteAT (23551)