라벨이 WPF인 게시물 표시

[WPF] How to programmatically click a button

Windows Forms 에서는 Button.PerformClick() 함수가 존재하였었는데,  WPF(Windows Presentation Foundation) 에서는 해당 함수가 존재하지 않는다. WPF에서 사 용할 수 있는 두가지 방법을 소개한다. <방법1. AutomationPeer 이용> Sample code : ---------------------------------------------------------------------------- using System.Windows.Automation.Peers; using System.Windows.Automation.Provider; ...  void ButtonClick() {   ButtonAutomationPeer peer = new ButtonAutomationPeer( TestButton );   IInvokeProvider invokeProv = peer.GetPattern(PatternInterface.Invoke) as IInvokeProvider;   invokeProv.Invoke();   NextFunction (); }  ----------------------------------------------------------------------------  - Invoke() 함수 로 클 릭 이벤트가 발생하여 ,  다음처리(NextFunction)가 진행 된 후 클릭이벤트가 발생한다 .  - 해당버튼이 Disabled 일 때 에는 System.Windows.Automation.ElementNotEnabledException 이 발생한다. <방법2. RaiseEvent 이용> Sample code : ---------------------------------------------------------------...

[WPF][WebBrowser] Allow Blocked Content Setting

<현상> WebBrowser에서 로컬웹문서를 열경우 아래와 같은 보안경고창이 뜬다.  - 보안을 위해 사용자의 웹 브라우저가 이파일에서 사용자의 컴퓨터를 액세스할수 있는 액티브 콘텐츠를 표시하는 것을 차단했습니다. 옵션을 보려면 여기를 클릭하십시오. <해결 방법> Mark of the Web (MOTW)을 웹문서 상단에 추가하면 된다. 1. <!-- saved from url=(0014)about:internet --> 2. <!-- saved from url=(0011)about:blank --> 3. <!-- saved from url=(0016)http://localhost --> 4. <!-- saved from url=(0027)http://imsoli.blogspot.com/ -->   * 참고로 url=(####) 의 숫자는 읽어들이는 길이를 나타낸다. <!-- saved from url=(0016)http://localhost1234 --> => "1234"는 무시한다. <예제> Sample.html  ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------  <!doctype html>  <!-- saved from url=(0027)http://imsoli.blogspot.com/ -->  <html>    <head>      <title>A Mark of the Web Sample.</title>    </head>    <body>       ...