728x90

www.microsoft.com/en-us/download/details.aspx?id=30425

 

OOXML SDK 2.5

This download provides strongly typed part and content classes for use with Open XML documents.

www.microsoft.com

 

using DSOFile;
OleDocumentProperties file = new OleDocumentProperties();

file.Open(@"C:myfile.docx", false, dsoFileOpenOptions.dsoOptionDefault);

int charCount = file.SummaryProperties.CharacterCount;

int wordCount = file.SummaryProperties.WordCount;

int pageCount = file.SummaryProperties.PageCount;

file.SummaryProperties.Author = "John Smith";

file.SummaryProperties.Category = "My Category";

file.SummaryProperties.Company = "My Company Inc.";

file.SummaryProperties.Manager = "David Smith";

file.SummaryProperties.Subject = "Sample files";

file.SummaryProperties.Title = "A very sample file";

file.Save();

file.Close(true);

728x90

'C# > WPF' 카테고리의 다른 글

C# Ctrl + C & V 키 사용하기  (0) 2021.04.01
C# Point 값 넣기  (0) 2021.03.29
Null 허용 개체에는 값이 있어야 합니다.  (0) 2021.03.11
WPF Process.Start 폴더 열기  (0) 2021.03.09
TextBox String을 int형으로 받아보는 방법  (0) 2021.02.25
728x90

System.InvalidOperationException: Null 허용 개체에는 값이 있어야 합니다.


발생 이유
insert 할 때 값이 허용 되기때문에, 공란으로 두면 null을 허용.

해결 방법
null 이나 숫자 0 등 어떠한 값이라도 넣어주어야 한다.

 

728x90

'C# > WPF' 카테고리의 다른 글

C# Point 값 넣기  (0) 2021.03.29
C# Office 문서 사용자 지정 속성 추가 및 편집  (0) 2021.03.15
WPF Process.Start 폴더 열기  (0) 2021.03.09
TextBox String을 int형으로 받아보는 방법  (0) 2021.02.25
C# 배열 삭제 함수  (0) 2021.02.15
728x90

 

 

 

728x90
728x90

Adorner 
UIElement 를 장식하는 FrameworkElement 를 나타내는 추상 클래스

UIElement에서 크기, 회전, 위치 변경 처럼 핸들 추가

728x90
728x90

MainWindow.xaml.cs

 

 

Class.CS

 

728x90
728x90

System.InvalidOperationException: '컬렉션이 수정되었습니다. 열거 작업이 실행되지 않을 수도 있습니다.'

 

발생 사유
foreach 내부에서 Add를 사용하여  Collection 수정을 하고자 하였음.

해결책
 1안. Collection 수정을 위해 foreach 대신 for으로 변경하여 사용
 2안. Collection 수정을 위해 foreach 대신 Find를 사용

728x90

'C#' 카테고리의 다른 글

Adorner ?  (0) 2021.03.08
Main 변수를 Class에서 사용 방법  (0) 2021.03.05
[WPF] 표시기 레이어 제거  (0) 2021.02.19
[WPF] 표시기 구현 방법  (0) 2021.02.19
Open CV 설치 및 패키지 구성 요소  (0) 2021.01.22
728x90

텍스트 박스 내용이 숫자 일 경우 숫자형으로 받아보는 방법.

int point_x = 0;
int point_y = 0;
int.TryPArse(textbox.Text, out point_x);
int.TryPArse(textbox.Text, out point_y);

728x90
728x90

 

이전 글에서는 레이어를 생성 하였지만, 이번에는 레이어를 제거 하였습니다.

사이즈 조절 후 레이어를 제거하여, 사이즈 조절이 필요 할 때마다 레이어가 다시 생성 되도록 하였습니다.

아래 예제는 마이크로소프트에서 제공하는 예제로써 이 예제를 이용하여 사용 하시면 됩니다.


1. 예제

Adorner[] toRemoveArray = myAdornerLayer.GetAdorners(myTextBox);
Adorner toRemove;
if (toRemoveArray != null)
{
      toRemove = toRemoveArray[
0];
      myAdornerLayer.Remove(toRemove);
}

 

2. 예제

try {
       myAdornerLayer.Remove((myAdornerLayer.GetAdorners(myTextBox))[
0]);
     }
catch { }

 

docs.microsoft.com/ko-kr/dotnet/desktop/wpf/controls/how-to-remove-an-adorner-from-an-element?view=netframeworkdesktop-4.8

728x90
728x90

 

사각형과 원형 사이즈 조절 기능을 구현하고자 표시기를 만들었습니다.

표시기는 위 형태로 생성 되었습니다.

표시기를 통하여 사이즈가 조절 되도록 하였습니다.

 

예제에는 표시기에는 고유 렌더링 동작이 포함되어 있지 않음에 유의해야 한다고 설명되어 있습니다.

Microsoft사에 예제가 있으니 참고 하시면 되겠습니다.

docs.microsoft.com/ko-kr/dotnet/desktop/wpf/controls/how-to-implement-an-adorner?view=netframeworkdesktop-4.8

728x90
728x90

 



List<string> list_str = new List<string>();


Remove

RemoveAt

RemoveAll

RemoveRange

728x90

+ Recent posts