logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Post a reply
From:
Message:

Maximum number of characters in each post is: 32767
Bold Italic Underline   Highlight Quote Choose Language for Syntax Highlighting Insert Image Insert an existing Attachment or upload a new File... Create Link   Unordered List Ordered List   Left Justify Center Justify Right Justify   Outdent Indent   More BBCode Tags
Font Color Font Size
Security Image:
Enter The Letters From The Security Image:
  Preview Post Cancel

Last 10 Posts (In reverse order)
Guest Posted: Monday, February 22, 2016 6:13:29 AM(UTC)
 
THANKS A LOT !
Paul Rayman Posted: Monday, February 22, 2016 5:47:19 AM(UTC)
 
Try to move it into Form.Shown event handler
Code:

private void Form1_Shown(Object sender, EventArgs e)
{
    pdfToolStripSearch1.Items["btnSearchBar"] as ToolStripControlHost).Control.Controls[0].Controls[0].Controls[0].Controls[0].Text = "document";
}
Guest Posted: Monday, February 22, 2016 12:45:27 AM(UTC)
 
I call in the constructor when i get this error.

Code:
        public ToolsFrm(Patagames.Pdf.Net.Controls.WinForms.PdfViewer viewer)
        {
            Patagames.Pdf.Net.PdfCommon.Initialize();
            this.PdfViewer = viewer;
      
            InitializeComponent();
            (pdfToolStripSearch1.Items["btnSearchBar"] as ToolStripControlHost).Control.Controls[0].Controls[0].Controls[0].Controls[0].Text = "document";
            cpt++;
           
        }
Paul Rayman Posted: Monday, February 22, 2016 12:30:48 AM(UTC)
 
At what point do you call this code?
May be at this moment the toolbar does not initialized yet?
Guest Posted: Sunday, February 21, 2016 11:40:55 PM(UTC)
 
thanks for your answer.

When i use your first method i have an error : (System.NullReferenceException)


at Patagames.Pdf.Net.Controls.WinForms.ToolBars.PdfToolStripSearch.StopSearch()
at Patagames.Pdf.Net.Controls.WinForms.ToolBars.PdfToolStripSearch.StartSearch(SearchBar sb, String searchText)
at Patagames.Pdf.Net.Controls.WinForms.ToolBars.PdfToolStripSearch.OnNeedSearch(ToolStripControlHost item, String searchText)
at Patagames.Pdf.Net.Controls.WinForms.ToolBars.PdfToolStripSearch.SearchBar_NeedSearch(Object sender, EventArgs e)
at Patagames.Pdf.Net.Controls.WinForms.ToolBars.SearchBar.OnSearch()
at Patagames.Pdf.Net.Controls.WinForms.ToolBars.SearchBar._onsearchTimer_Tick(Object sender, EventArgs e)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at Planche.App.Main() in C:\Users\9305924K\Desktop\Planche main\Master\Planche\Planche\obj\Debug\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Paul Rayman Posted: Friday, February 19, 2016 1:25:00 AM(UTC)
 
Well... I can suggest a ugly hack
Code:

(pdfToolStripSearch1.Items["btnSearchBar"] as ToolStripControlHost).Control.Controls[0].Controls[0].Controls[0].Controls[0].Text = "document";


or you can make some changes in source code:

change the visibility of the following classes to public instead internal.
internal class ToolStripSearchBar
internal class SearchBar

in ToolStripSearchBar change the internal SearchBar property to public

in PdfToolStripSearch write somthing like this:
Code:

public SearchBar SearchBar
{
	get
	{
		return (this.Items["btnSearchBar"] as ToolStripSearchBar).Control as SearchBar;
	}
}


and now you can use it like this:
Code:

pdfToolStripSearch1.SearchBar.SearchText = "document";


Guest Posted: Friday, February 19, 2016 12:08:56 AM(UTC)
 
Hi,

is it possible to set text in the search bar in toolbox dynamically ?

In Patagames.Pdf.Net.Controls.WinForms.ToolBars.PdfToolStripSearch()

Thanks