pcinfogmach
-
ספר טלפונים ב-html -
C# webview2 navigatetostring- טעינת טקסט בפקדפתרון מאולתר:
אני יוצר list ששומר את כל הwebviews בתוך thisaddin ואז כך שהתוכנה מתעלמת מכל שגיאה שקורית בסגירת הwebviewprivate void ThisAddIn_Shutdown(object sender, System.EventArgs e) { try { foreach (WebView2 webView in webviewlist) { webView.Dispose(); } } catch (Exception){ } }
-
קיצורי מקשים באפליקציית C# WPFאשמח אם מישהו יכול להדריך אותי איך יוצרים קיצורי מקשים גלובליים באפליקצייה של wpf ב C#
לדוגמא cntrl +o לפתיחת קובץ וכן הלאה
תודה מראש
-
שמירת חשבונית בעיצוב HTML בשרת@ASS
למה שלא תשמור את הinnerhtml ? -
מסד נתונים בענן... התייעצותאולי אפשר רעיון כזה בו אתה פותח את הטבלה עצמה בגוגל דרייב עצמו דרך פקד webbrowser בתוך יוזר פורם
כמובן שתלוי מאוד מה התפקיד של הטבלאות וכו' -
wpf tabcontrol כמו של winformsהצלחתי ב"ה
עריכה: הוספתי לו גם אפשרות להחליף מקומות של הטאבים:
<Window x:Class="wpflistview.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" Title="MainWindow" Height="500" Width="800" > <Window.Resources> <!-- Style for the TabControl --> <Style x:Key="TabControlStyle" TargetType="TabControl"> <Setter Property="AllowDrop" Value="True"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="TabControl"> <Grid x:Name="TabcontrolMainGrid"> <Border x:Name="TabcontrolMainBorder2" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True"> <Grid x:Name="TabcontrolMainGrid2"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <!-- ListBox for headers --> <Grid x:Name="listBoxcontainerGrid" Grid.Row="0" Margin="0,0,0,-20"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"/> <ColumnDefinition Width="Auto"/> </Grid.ColumnDefinitions> <ListBox x:Name="TabHeaderListBox" Margin="0" Grid.Column="0" Padding="-2,-2,0,1" ScrollViewer.HorizontalScrollBarVisibility="Visible" SelectionChanged="TabHeaderListBox_SelectionChanged" ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Items}" SelectedItem="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedItem}" BorderBrush="{x:Null}" IsEnabled="True" Background="#FFFAFAFA"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal" /> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ItemTemplate> <DataTemplate> <Border x:Name="TabItemBorder" BorderThickness="1" BorderBrush="{x:Null}" Padding="5,2,5,2" Margin="-3,0,-3,0" PreviewMouseMove="TabItemBorder_PreviewMouseMove" DragOver="TabItemBorder_DragOver"> <Border.Effect> <DropShadowEffect ShadowDepth="1" BlurRadius="1" Color="Black" Opacity="0.5"/> </Border.Effect> <Border.Style> <Style TargetType="Border"> <Setter Property="Background" Value="#F0F0F0"/> <Style.Triggers> <DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}" Value="True"> <Setter Property="Background" Value="White"/> </DataTrigger> <!--<DataTrigger Binding="{Binding IsMouseOver, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}" Value="True"> <Setter Property="Background" Value="#40BFD4FF"/> </DataTrigger> <DataTrigger Binding="{Binding IsMouseOff, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}" Value="True"> <Setter Property="Background" Value="#F0F0F0"/> </DataTrigger>--> </Style.Triggers> </Style> </Border.Style> <StackPanel Orientation="Horizontal"> <TextBlock x:Name="tabItemTextBlock" Text="{Binding Header}" Margin="0,2,5,0"/> <Button Content="X" x:Name="TabCloseButton" Width="20" Height="20" Click="TabCloseButton_Click" Command="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type TabControl}}, Path=DataContext.CloseTabCommand}" CommandParameter="{Binding}" Background="{x:Null}" BorderBrush="{x:Null}" /> </StackPanel> </Border> </DataTemplate> </ListBox.ItemTemplate> </ListBox> <DockPanel HorizontalAlignment="Right" Background="#FFFAFAFA" Margin="0,3,2,23" Height="23"> <Button x:Name="TabscrollLeft" Content="◁" Click="TabscrollLeft_Click" Background="#F0F0F0" BorderThickness="0" BorderBrush="{x:Null}" Margin="0,0,2,0"> <Button.Effect> <DropShadowEffect ShadowDepth="1" BlurRadius="1" Color="Black" Opacity="0.5"/> </Button.Effect> </Button> <Button x:Name="TabsDropDown" Content="▽" Click="TabsDropDown_Click" Background="#F0F0F0" BorderThickness="0" BorderBrush="{x:Null}" Margin="0,0,2,0"> <Button.Effect> <DropShadowEffect ShadowDepth="1" BlurRadius="1" Color="Black" Opacity="0.5"/> </Button.Effect> <Button.ContextMenu> <ContextMenu/> </Button.ContextMenu> </Button> <Button x:Name="TabscrollRight" Content="▷" Click="TabscrollRight_Click" Background="#F0F0F0" BorderThickness="0" BorderBrush="{x:Null}"> <Button.Effect> <DropShadowEffect ShadowDepth="1" BlurRadius="1" Color="Black" Opacity="0.5"/> </Button.Effect> </Button> </DockPanel> </Grid> <!-- Content row --> <Border Grid.Row="1" Height="0.5" Background="{TemplateBinding BorderBrush}"/> <Border Grid.Row="2" x:Name="ContentPanel" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0.5" Background="{TemplateBinding Background}" SnapsToDevicePixels="True"> <ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> </Border> </Grid> </Border> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> </Window.Resources> <Grid> <!-- Apply the custom style to the TabControl --> <TabControl Style="{StaticResource TabControlStyle}"> <!-- Add your tabs here --> <TabItem Header="Tab 1"> <!-- Tab 1 content --> </TabItem> <TabItem Header="Tab 2"> <!-- Tab 2 content --> </TabItem> <!-- Add more tabs as needed --> <TabItem Header="Tab 3"> asdfasdfasf </TabItem> <TabItem Header="Tab 4"> דכגשדגכשדכשדגכשדכג </TabItem> <!-- Add more tabs as needed --> <TabItem Header="Tab 5"> <!-- Tab 1 content --> </TabItem> <TabItem Header="Tab 6"> <!-- Tab 2 content --> </TabItem> <!-- Add more tabs as needed --> <TabItem Header="Tab 7"> <!-- Tab 1 content --> </TabItem> <TabItem Header="Tab 8"> <!-- Tab 2 content --> </TabItem> <!-- Add more tabs as needed --> </TabControl> </Grid> </Window>
using BetterTabs; using FirstFloor.ModernUI.Windows.Media; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace wpflistview { /// <summary> /// Interaction logic for MainWindow.xaml /// </summary> /// public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } private void TabCloseButton_Click(object sender, RoutedEventArgs e) { // Handle the close button click event here if (sender is Button closeButton && closeButton.DataContext is TabItem tabItem) { // Your custom logic to close the tab // For example, remove the tab from the TabControl's Items collection var tabControl = FindParent<TabControl>(closeButton); (tabControl?.Items)?.Remove(tabItem); } } private void TabscrollLeft_Click(object sender, RoutedEventArgs e) { var tabControl = FindParent<TabControl>(sender as DependencyObject); if (tabControl != null) { int currentIndex = tabControl.SelectedIndex; if (currentIndex > 0) { tabControl.SelectedIndex = currentIndex - 1; } } } private void TabsDropDown_Click(object sender, RoutedEventArgs e) { Button button = (Button)sender; ContextMenu contextMenu = new ContextMenu(); foreach (TabItem tabItem in ((TabControl)button.TemplatedParent).Items) { MenuItem menuItem = new MenuItem { Header = tabItem.Header, Tag = tabItem }; menuItem.Click += TabMenuItem_Click; contextMenu.Items.Add(menuItem); } button.ContextMenu = contextMenu; button.ContextMenu.IsOpen = true; } private void TabMenuItem_Click(object sender, RoutedEventArgs e) // Event handler for context menu item click { ((ContextMenu)((MenuItem)sender).Parent).IsOpen = false; // Close the context menu TabItem selectedTab = (TabItem)((MenuItem)sender).Tag; // Get the associated TabItem from the Tag property ((TabControl)selectedTab.Parent).SelectedItem = selectedTab; // Set the selected tab in the TabControl } private void TabscrollRight_Click(object sender, RoutedEventArgs e) { var tabControl = FindParent<TabControl>(sender as DependencyObject); if (tabControl != null) { int currentIndex = tabControl.SelectedIndex; if (currentIndex < tabControl.Items.Count - 1) { tabControl.SelectedIndex = currentIndex + 1; } } } private static T FindParent<T>(DependencyObject child) where T : DependencyObject { // Find the parent of a specified type in the visual tree while (true) { DependencyObject parentObject = VisualTreeHelper.GetParent(child); if (parentObject == null) { return null; } if (parentObject is T parent) { return parent; } child = parentObject; } } private void TabHeaderListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { ListBox listBox = (ListBox)sender; if (listBox.SelectedItem != null) { listBox.ScrollIntoView(listBox.SelectedItem); } } private static T FindAncestor<T>(DependencyObject current) where T : DependencyObject { do { if (current is T ancestor) { return ancestor; } current = VisualTreeHelper.GetParent(current); } while (current != null); return null; } private void TabItemBorder_PreviewMouseMove(object sender, MouseEventArgs e) { if (sender is Border border && border.DataContext is TabItem tabItem && Mouse.PrimaryDevice.LeftButton == MouseButtonState.Pressed) { DragDrop.DoDragDrop(tabItem, tabItem, DragDropEffects.All); } } private void TabItemBorder_DragOver(object sender, DragEventArgs e) { if (e.Data.GetData(typeof(TabItem)) is TabItem tabItemSource && sender is Border border && border.DataContext is TabItem tabItemTarget && tabItemTarget.Parent is TabControl TergetTabControl) { int targetIndex = TergetTabControl.Items.IndexOf(tabItemTarget); TabControl SourceControl = tabItemSource.Parent as TabControl; SourceControl.Items.Remove(tabItemSource); TergetTabControl.Items.Insert(targetIndex, tabItemSource); tabItemSource.IsSelected = true; } } } }
-
wpf tabcontrol כמו של winformsתמונה של התוכנה עם הקוד הנ"ל.
-
AvalonDock בחלון קטן@dovid
אתה צודק הבעיה היתה בפקד - תודה! -
AvalonDock בחלון קטןאני משתמש עם avalonDock ב wpf
נתקלתי בבעיה כאשר החלון מצטמצם שאם החלון מפוצל לשניים אזי החלון העליון עולה מעל החלון התחתון ומסתיר את סרגל הכלים שלוכאשר התצוגה מצומצמצת המסמכים מתקרבים מדאי וחופפים אחד על השני
ככה אמור להיות:
זה מה שקורה כאשר החלון מוקטן - החלון העליון דורס את סרגל הכלים ואת הטאבים של התחתון:
-
AvalonDock WPF איך מוסיפים באופן תקין LayoutDocumentאני מנסה להשתמש בAvalonDock (פלטפורמה המדמה את הפלטפרומה של Visualstudio) עם טאבים נסגרים וחלונות נגררים ועוד ועוד מצו"ב תמונה.
נתקלתי בבאג שאם אני מצמיד אפילו אחד המסמכים למטה ואז סוגר את המסמכים למעלה שוב כל טעינה של מסמך חדש אינו מוצג כלל. אשמח לפיתרון
הנה הקוד שלי. (את הפלטפורמה אני יוצר בwpf) ואת המסמכים אני מוסיף דינאמית בC#.WPF
<DockingManager x:Name="dockManager"> <!--Define your layout here--> <LayoutRoot> <LayoutPanel Orientation="Horizontal"> <!--Main Content Area--> <LayoutDocumentPane x:Name="documentPane"> <!--Add more documents as needed--> </LayoutDocumentPane> </LayoutPanel> </LayoutRoot> </DockingManager>
והקוד בc# להוספה דינאמית של מסמכים
private void AddNewTab(string title) { \\לא יודע למה צריך להוסיף grid אבל בלי זה הוא נותן לי שגיאות מוזרות. Grid newGrid = new Grid(); newGrid.Children.Add(cntrlBookView); LayoutDocument newLayoutDocument = new LayoutDocument { Title = title, Content = newGrid }; cntrlBookView.layoutDocument = newLayoutDocument; newLayoutDocument.IsActive = true; documentPane.Children.Add(newLayoutDocument); newLayoutDocument.IsActive = false; }
-
wpf treeview עם scrollBar יותר יפה@dovid כתב בwpf treeview עם scrollBar יותר יפה:
חפש בגוגל WPF THEMES ותמצא משהו כלבבך ובדוק שהוא מספיק מתוחזק/פופולרי ותשתמש בו.
לא מצאתי משהו שמטפל בscrollbar מישהו מכיר?
-
html לחיץ אבל גם שיאפשר בחירהאני מנסה ליצור דף html בו כל האלמנטים של li הם לחיצים לדוגמא מחזיר את מספר האלמנט. אבל בלי לאבד את הנוחות של בחירת הטקסט והעתקתו. ש משהו דומה בספריא.
בעצם הרעיון הוא שאם למשל יש לי מסמך שמציג את החומש אז כל פסוק יהיה אפשר ללחוץ עליו כדי לקבל מפרשים וכו'.
הבעיה שניתקלתי בה שברגע שהגדרתי את האלמנט כלחיץ אז זה מפריע לבחירת הטקסט בלי לחיצה עליו.מקווה שהשאלה מספיק ברורה
מצו"ב הקוד שעשיתי לבינתיים
<!DOCTYPE html> <html lang="he"> <head> <meta charset="UTF-8"> <style> body { text-align: right; text-align: justify; direction: rtl; } h2 { cursor: pointer; color: #4169E1; } h3 { cursor: pointer; color: #6495ED; } ol { list-style-type: hebrew; } li:hover { background-color: #f0f0f0; /* Change the background color to your desired color */ } </style> </head> <body> <h1>במדבר</h1> <h2>פרק א</h2> <ol list-style-type: hebrew;> <li>וַיְדַבֵּ֨ר יְהֹוָ֧ה אֶל־מֹשֶׁ֛ה בְּמִדְבַּ֥ר סִינַ֖י בְּאֹ֣הֶל מוֹעֵ֑ד בְּאֶחָד֩ לַחֹ֨דֶשׁ הַשֵּׁנִ֜י בַּשָּׁנָ֣ה הַשֵּׁנִ֗ית לְצֵאתָ֛ם מֵאֶ֥רֶץ מִצְרַ֖יִם לֵאמֹֽר׃</li> <li>שְׂא֗וּ אֶת־רֹאשׁ֙ כׇּל־עֲדַ֣ת בְּנֵֽי־יִשְׂרָאֵ֔ל לְמִשְׁפְּחֹתָ֖ם לְבֵ֣ית אֲבֹתָ֑ם בְּמִסְפַּ֣ר שֵׁמ֔וֹת כׇּל־זָכָ֖ר לְגֻלְגְּלֹתָֽם׃</li> <li>מִבֶּ֨ן עֶשְׂרִ֤ים שָׁנָה֙ וָמַ֔עְלָה כׇּל־יֹצֵ֥א צָבָ֖א בְּיִשְׂרָאֵ֑ל תִּפְקְד֥וּ אֹתָ֛ם לְצִבְאֹתָ֖ם אַתָּ֥ה וְאַהֲרֹֽן׃</li> <li>וְאִתְּכֶ֣ם יִהְי֔וּ אִ֥ישׁ אִ֖ישׁ לַמַּטֶּ֑ה אִ֛ישׁ רֹ֥אשׁ לְבֵית־אֲבֹתָ֖יו הֽוּא׃</li> <li>וְאֵ֙לֶּה֙ שְׁמ֣וֹת הָֽאֲנָשִׁ֔ים אֲשֶׁ֥ר יַֽעַמְד֖וּ אִתְּכֶ֑ם לִרְאוּבֵ֕ן אֱלִיצ֖וּר בֶּן־שְׁדֵיאֽוּר׃</li> <li>לְשִׁמְע֕וֹן שְׁלֻמִיאֵ֖ל בֶּן־צוּרִֽישַׁדָּֽי׃</li> <li>לִֽיהוּדָ֕ה נַחְשׁ֖וֹן בֶּן־עַמִּינָדָֽב׃</li> <li>לְיִ֨שָׂשכָ֔ר נְתַנְאֵ֖ל בֶּן־צוּעָֽר׃</li> </ol> <script> // Define the onclick handler globally function showAlert() { // Check if the clicked element is an ol if (this.tagName.toLowerCase() === 'li' && this.parentElement.tagName.toLowerCase() === 'ol') { // Get the ordered list number and show an alert alert(Array.from(this.parentElement.children).indexOf(this) + 1); } else { // If not an ol, show the text content alert(this.textContent); } } // Attach the click event to all elements with the correct classes var customHeader = document.querySelectorAll('.customHeader'); var customHeader2 = document.querySelectorAll('.customHeader2'); customHeader.forEach(function (header) { header.addEventListener('click', showAlert); }); customHeader2.forEach(function (header) { header.addEventListener('click', showAlert); }); // Attach the click event to all h1 elements var h3Elements = document.querySelectorAll('h3'); h3Elements.forEach(function (h3) { h3.addEventListener('click', showAlert); }); // Attach the click event to all h2 elements var h2Elements = document.querySelectorAll('h2'); h2Elements.forEach(function (h2) { h2.addEventListener('click', showAlert); }); var liElements = document.querySelectorAll('li'); liElements.forEach(function (li) { li.addEventListener('click', showAlert); }); </script> </body> </html>
-
שאלה בwpf האם יש דרך להסיר את הצל שסביב האובייקט window@קומפיונט כתב בשאלה בwpf האם יש דרך להסיר את הצל שסביב האובייקט window:
חלון קלאסי מקבל את העיטורים והלחצנים (של ה'סגור', 'מזער' וכו') ממערכת ההפעלה, זה משתנה בין מערכות הפעלה וזה כולל גם את הצל שמסביב, אם אתה רוצה חלון ללא עיטורים תגדיר את
WindowStyle
ל -None
, בכזה מקרה תקבל מלבן לבן בלי שם דברים מסביב.לא עזר בשביל הצל רק לשאר הדברים
צריך לעשות גם AllowsTransparency = true;
כמו ש@קומפיונט כתב
אבל מסתבר שאם עושים את זה אז מאבדים את היכולת לשנות את הגודל של החלון. -
שאלה בC# האם יש דרך קלה להוסיף כפתור dropdown@dovid כתב בשאלה בC# האם יש דרך קלה להוסיף כפתור dropdown:
ותשנה את הLayout Style שלו לFlow ואת הGrid Style לHidden.
כוונתך כנראה ל-Grip style
ושוב תודה על הכל
-
קוד לעורך טקסט בhtml - שמישהו שלח לי - אולי יהיה שימושי למישהו@121244 כתב בקוד לעורך טקסט בhtml - שמישהו שלח לי - אולי יהיה שימושי למישהו:
@pcinfogmach
זה מה שעשיתי מזה https://795697842.000webhostapp.com/CreatingHtmlמדהים!
אגב צריך לסדר את הגודל של הלחצנים בסרגל -
שלאה בקוד C#: איך לעשות חיפוש בתוך מסמך html שהוא פתוח בwebbrowser@dovid
תודה על ההיענותצור חלונית צד בvsto
הוסף פקד webbrowser
ועוד כפתור
הזן קוד זה עבור הכפתורprivate void button1_Click(object sender, EventArgs e) { // Generate a temporary file name string tempHtmlFile = Path.GetTempFileName() + ".html"; // Create and write the HTML content to the temporary file File.WriteAllText(tempHtmlFile, @" <!DOCTYPE html> <html> <head> <meta http-equiv='X-UA-Compatible' content='IE=10'> <script> function showMessage() { alert('Button clicked!'); } </script> </head> <body> <button onclick='showMessage()'>Click Me</button> </body> </html> "); // Load the temporary HTML file into the WebBrowser control webBrowser1.Navigate(tempHtmlFile); } }
וכך זה נראה
-
שלאה בקוד C#: איך לעשות חיפוש בתוך מסמך html שהוא פתוח בwebbrowserמסתבר שטעיתי הקוד שהבאתי לא עשה כלום - הסיבה שלא היה את הבעיה כי במקום לטעון מסמך html עשיתי הזרקה של טקסט לתוך עמוד about:blank
ניסיתי את הקוד שלך וגם לא עזר - אז עכשיו שוב אני תקוע.
(ולעשות כל פעם הזרקה של טקסט במקום טעינת עמוד זה קצת בעייתי מכיון שאני צריך את הפונקציונליות של תנועה קדימה ואחורה בדפים שהמשתמש פתח).
-
שלאה בקוד C#: איך לעשות חיפוש בתוך מסמך html שהוא פתוח בwebbrowser@dovid
ממש תודה! פשוט אין מילים@dovid כתב בשלאה בקוד C#: איך לעשות חיפוש בתוך מסמך html שהוא פתוח בwebbrowser:
בWinForms יש לזה פתרון, אבל סביר שהוא לא עובד בVSTO (אולי כן, תבדוק)
לבינתיים הקוד הזה עשה את העבודה וגם אין צורך לשחק ברגסטרי
<meta http-equiv='X-UA-Compatible' content='IE=10'>
ושוב תודה
-
שאלה: איך עושים בתוסף vsto לוורד שtaskpane יישאר תמיד בחלונית האקטיבית@dovid
מצאתי פיתרון!Globals.ThisAddIn.Application.WindowDeactivate += Application_WindowDeactivate; private void Application_WindowDeactivate(Document Doc, Window Wn) { if (taskPane != null && taskPane.Visible) { windowSnap = true; } }
זה קולט את המצב של החלונית צד בעת פתיחת מסמך חדש.
אבל מצאתי גם בעיה אחרת
כאשר סוגרים מסמך ללא שמירה החלונית נעלמת עד המעבר הבא בין מסמכים.
לבינתיים רק מצאתי לזה אילתור מצחיק ובלתי מומלץ מסיבות פשוטותGlobals.ThisAddIn.Application.DocumentBeforeClose += Application_DocumentBeforeClose; private void Application_DocumentBeforeClose(Document Doc, ref bool Cancel) { Globals.ThisAddIn.Application.ActiveWindow.WindowState = WdWindowState.wdWindowStateMinimize; }
מה שיוצר מצב שהחלונית הנסגרת איננה החלונית האקטיבית
-
שאלה: איך עושים בתוסף vsto לוורד שtaskpane יישאר תמיד בחלונית האקטיביתאני רוצה לסכם היכן אנחנו אוחזים:
בעצם יש לנו קוד נפלא של @dovid שמעביר את החלונית צד מממסמך למסמך בצורה נקייה וטובה.
אפשר להגדיר bool שיקבל ערך שקר בעת לחיצה על לחצן הסגירה של חלונית הצד על ידי taskPane.VisibleChanged += TaskPane_VisibleChanged;
ומאידך יקבל ערך אמת על ידי לחיצה על כפתור הפתיחה של החלונית צד.
אפשר גם להוסיף עוד bool ב settings של התוכנה שיתן למשתמש אפשרות לבחור אם החלונית צד תקפוץ ממסמך למסמך או לא.
ויש לנו את ההצעה של @YAKOV2024 שטוען שאולי אפשר להשתמש עם רשימה שרושמת את המסמכים הפתוחים ובכך נוכל להגדיר שרק במסמך המסויים בו נסגר החלונית צד שמה לא יצוץ שוב אבל יישאר בכל שאר המסמכים.