דילוג לתוכן
  • דף הבית
  • קטגוריות
  • פוסטים אחרונים
  • משתמשים
  • חיפוש
  • חוקי הפורום
כיווץ
תחומים

תחומים - פורום חרדי מקצועי

💡 רוצה לזכור קריאת שמע בזמן? לחץ כאן!
pcinfogmachP

pcinfogmach

@pcinfogmach
אודות
פוסטים
690
נושאים
185
קבוצות
0
עוקבים
3
עוקב אחרי
1

פוסטים

פוסטים אחרונים הגבוה ביותר שנוי במחלוקת

  • עיצוב מודרני עבור ScrollBar ב- Wpf
    pcinfogmachP pcinfogmach

    מצו"ב הקוד (מתאים במיוחד עבור DarkTheme)
    b7e2b204-9a70-4b9a-b3f4-bd461ed4d20f-image.png

    <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                        xmlns:system="clr-namespace:System;assembly=mscorlib">
    
        <system:Double x:Key="ScrollBarWidth">16</system:Double>
        <system:Double x:Key="ScrollBarArrowHeight">4</system:Double>
        <system:Double x:Key="ScrollBarArrowWidth">8</system:Double>
    
        <SolidColorBrush x:Key="ScrollBarButtonBackgroundBrush" Color="#888888" Opacity="0.4" />
        <SolidColorBrush x:Key="ScrollBarButtonHighlightBackgroundBrush" Color="#B0B0B0" Opacity="0.4" />
    
        <Style TargetType="{x:Type ScrollBar}">
            <Setter Property="Foreground" Value="#FF999999"/>
            <Style.Triggers>
                <Trigger Property="Orientation" Value="Vertical">
                    <Setter Property="Width" Value="{StaticResource ScrollBarWidth}"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type ScrollBar}">
                                <Border BorderThickness="1">
                                    <Border.BorderBrush>
                                        <SolidColorBrush Color="#888888" Opacity="0.6"/>
                                    </Border.BorderBrush>
                                    <Border.Background>
                                        <SolidColorBrush Color="#888888" Opacity="0.1"/>
                                    </Border.Background>
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="Auto"/>
                                            <RowDefinition Height="*"/>
                                            <RowDefinition Height="Auto"/>
                                        </Grid.RowDefinitions>
    
                                        <Button Grid.Row="0"
                                            Command="ScrollBar.LineUpCommand"
                                            Height="{StaticResource ScrollBarWidth}">
                                            <Button.Template>
                                                <ControlTemplate TargetType="Button">
                                                    <Grid>
                                                        <Rectangle x:Name="ButtonRectangle" 
                                                               Fill="Transparent"/>
                                                        <Path x:Name="ButtonPath" HorizontalAlignment="Center"
                                                          VerticalAlignment="Center"
                                                          Data="M 0 10 L 10 10 L 5 0 Z" 
                                                          Fill="{Binding Foreground, RelativeSource={RelativeSource AncestorType=ScrollBar}}"
                                                          Stretch="Fill"
                                                          Height="{StaticResource ScrollBarArrowHeight}"
                                                          Width="{StaticResource ScrollBarArrowWidth}" />
                                                    </Grid>
                                                    <ControlTemplate.Triggers>
                                                        <Trigger Property="IsMouseOver" Value="True">
                                                            <Setter TargetName="ButtonRectangle" Property="Fill" Value="{StaticResource ScrollBarButtonHighlightBackgroundBrush}" />
                                                        </Trigger>
                                                    </ControlTemplate.Triggers>
                                                </ControlTemplate>
                                            </Button.Template>
                                        </Button>
    
                                        <Track Name="PART_Track" IsDirectionReversed="True" VerticalAlignment="Stretch" Grid.Row="1">
                                            <Track.DecreaseRepeatButton>
                                                <RepeatButton Command="ScrollBar.PageUpCommand"
                                                          Background="Transparent">
                                                    <RepeatButton.Template>
                                                        <ControlTemplate TargetType="RepeatButton">
                                                            <Rectangle Fill="{TemplateBinding Background}" 
                                                                   Height="{TemplateBinding ActualHeight}"
                                                                   Width="{TemplateBinding ActualWidth}" />
                                                        </ControlTemplate>
                                                    </RepeatButton.Template>
                                                </RepeatButton>
                                            </Track.DecreaseRepeatButton>
    
                                            <Track.Thumb>
                                                <Thumb>
                                                    <Thumb.Template>
                                                        <ControlTemplate TargetType="Thumb">
                                                            <Rectangle x:Name="ThumbRectangle" 
                                                                   Fill="{StaticResource ScrollBarButtonBackgroundBrush}" 
                                                                   Margin="1,0,1,0"/>
                                                            <ControlTemplate.Triggers>
                                                                <Trigger Property="IsMouseOver" Value="True">
                                                                    <Setter TargetName="ThumbRectangle" Property="Fill" Value="{StaticResource ScrollBarButtonHighlightBackgroundBrush}" />
                                                                </Trigger>
                                                            </ControlTemplate.Triggers>
                                                        </ControlTemplate>
                                                    </Thumb.Template>
                                                </Thumb>
                                            </Track.Thumb>
    
                                            <Track.IncreaseRepeatButton>
                                                <RepeatButton Command="ScrollBar.PageDownCommand" 
                                                          Background="Transparent">
                                                    <RepeatButton.Template>
                                                        <ControlTemplate TargetType="RepeatButton">
                                                            <Rectangle Fill="{TemplateBinding Background}" 
                                                                   Height="{TemplateBinding ActualHeight}"
                                                                   Width="{TemplateBinding ActualWidth}" />
                                                        </ControlTemplate>
                                                    </RepeatButton.Template>
                                                </RepeatButton>
                                            </Track.IncreaseRepeatButton>
                                        </Track>
    
                                        <Button Grid.Row="2"
                                            Command="ScrollBar.LineDownCommand"
                                            Height="{StaticResource ScrollBarWidth}">
                                            <Button.Template>
                                                <ControlTemplate TargetType="Button">
                                                    <Grid>
                                                        <Rectangle x:Name="ButtonRectangle" 
                                                               Fill="Transparent"/>
                                                        <Path HorizontalAlignment="Center"
                                                          VerticalAlignment="Center"
                                                          Data="M 0 0 L 10 0 L 5 10 Z"
                                                          Fill="{Binding Foreground, RelativeSource={RelativeSource AncestorType=ScrollBar}}"
                                                          Stretch="Fill"
                                                          Height="{StaticResource ScrollBarArrowHeight}"
                                                          Width="{StaticResource ScrollBarArrowWidth}" />
                                                    </Grid>
                                                    <ControlTemplate.Triggers>
                                                        <Trigger Property="IsMouseOver" Value="True">
                                                            <Setter TargetName="ButtonRectangle" Property="Fill" Value="{StaticResource ScrollBarButtonHighlightBackgroundBrush}" />
                                                        </Trigger>
                                                    </ControlTemplate.Triggers>
                                                </ControlTemplate>
                                            </Button.Template>
                                        </Button>
                                    </Grid>
                                </Border>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Trigger>
    
                <Trigger Property="Orientation" Value="Horizontal">
                    <Setter Property="Foreground" Value="#FF999999"/>
                    <Setter Property="Height" Value="{StaticResource ScrollBarWidth}"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="{x:Type ScrollBar}">
                                <Border BorderThickness="1">
                                    <Border.BorderBrush>
                                        <SolidColorBrush Color="#888888" Opacity="0.6"/>
                                    </Border.BorderBrush>
                                    <Border.Background>
                                        <SolidColorBrush Color="#888888" Opacity="0.1"/>
                                    </Border.Background>
                                    <Grid>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="Auto"/>
                                            <ColumnDefinition Width="*"/>
                                            <ColumnDefinition Width="Auto"/>
                                        </Grid.ColumnDefinitions>
    
                                        <Button Grid.Column="0"
                                            Command="ScrollBar.LineLeftCommand"
                                            Width="{StaticResource ScrollBarWidth}">
                                            <Button.Template>
                                                <ControlTemplate TargetType="Button">
                                                    <Grid>
                                                        <Rectangle x:Name="ButtonRectangle" 
                                                               Fill="Transparent"/>
                                                        <Path HorizontalAlignment="Center"
                                                          VerticalAlignment="Center"
                                                          Data="M 0 5 L 10 0 L 10 10 Z"
                                                          Fill="{Binding Foreground, RelativeSource={RelativeSource AncestorType=ScrollBar}}"
                                                          Stretch="Fill"
                                                          Height="{StaticResource ScrollBarArrowWidth}"
                                                          Width="{StaticResource ScrollBarArrowHeight}" />
                                                    </Grid>
                                                    <ControlTemplate.Triggers>
                                                        <Trigger Property="IsMouseOver" Value="True">
                                                            <Setter TargetName="ButtonRectangle" Property="Fill" Value="{StaticResource ScrollBarButtonHighlightBackgroundBrush}" />
                                                        </Trigger>
                                                    </ControlTemplate.Triggers>
                                                </ControlTemplate>
                                            </Button.Template>
                                        </Button>
    
                                        <Track Name="PART_Track" IsDirectionReversed="False" HorizontalAlignment="Stretch" Grid.Column="1">
                                            <Track.DecreaseRepeatButton>
                                                <RepeatButton Command="ScrollBar.PageLeftCommand"
                                                          Background="Transparent">
                                                    <RepeatButton.Template>
                                                        <ControlTemplate TargetType="RepeatButton">
                                                            <Rectangle Fill="{TemplateBinding Background}" 
                                                                   Height="{TemplateBinding ActualHeight}"
                                                                   Width="{TemplateBinding ActualWidth}" />
                                                        </ControlTemplate>
                                                    </RepeatButton.Template>
                                                </RepeatButton>
                                            </Track.DecreaseRepeatButton>
    
                                            <Track.Thumb>
                                                <Thumb>
                                                    <Thumb.Template>
                                                        <ControlTemplate TargetType="Thumb">
                                                            <Rectangle x:Name="ThumbRectangle" 
                                                                   Fill="{StaticResource ScrollBarButtonBackgroundBrush}" 
                                                                       Margin="0,1,0,1"/>
                                                            <ControlTemplate.Triggers>
                                                                <Trigger Property="IsMouseOver" Value="True">
                                                                    <Setter TargetName="ThumbRectangle" Property="Fill" Value="{StaticResource ScrollBarButtonHighlightBackgroundBrush}" />
                                                                </Trigger>
                                                            </ControlTemplate.Triggers>
                                                        </ControlTemplate>
                                                    </Thumb.Template>
                                                </Thumb>
                                            </Track.Thumb>
    
                                            <Track.IncreaseRepeatButton>
                                                <RepeatButton Command="ScrollBar.PageRightCommand" 
                                                          Background="Transparent">
                                                    <RepeatButton.Template>
                                                        <ControlTemplate TargetType="RepeatButton">
                                                            <Rectangle Fill="{TemplateBinding Background}" 
                                                                   Height="{TemplateBinding ActualHeight}"
                                                                   Width="{TemplateBinding ActualWidth}" />
                                                        </ControlTemplate>
                                                    </RepeatButton.Template>
                                                </RepeatButton>
                                            </Track.IncreaseRepeatButton>
                                        </Track>
    
                                        <Button Grid.Column="2"
                                            Command="ScrollBar.LineRightCommand"
                                            Width="{StaticResource ScrollBarWidth}">
                                            <Button.Template>
                                                <ControlTemplate TargetType="Button">
                                                    <Grid>
                                                        <Rectangle x:Name="ButtonRectangle" 
                                                               Fill="Transparent"/>
                                                        <Path HorizontalAlignment="Center"
                                                          VerticalAlignment="Center"
                                                          Data="M 10 5 L 0 0 L 0 10 Z"
                                                          Fill="{Binding Foreground, RelativeSource={RelativeSource AncestorType=ScrollBar}}"
                                                          Stretch="Fill"
                                                          Height="{StaticResource ScrollBarArrowHeight}"
                                                          Width="{StaticResource ScrollBarArrowWidth}" />
                                                    </Grid>
                                                    <ControlTemplate.Triggers>
                                                        <Trigger Property="IsMouseOver" Value="True">
                                                            <Setter TargetName="ButtonRectangle" Property="Fill" Value="{StaticResource ScrollBarButtonHighlightBackgroundBrush}" />
                                                        </Trigger>
                                                    </ControlTemplate.Triggers>
                                                </ControlTemplate>
                                            </Button.Template>
                                        </Button>
                                    </Grid>
                                </Border>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Trigger>
            </Style.Triggers>
        </Style>
    </ResourceDictionary>
    
    

  • WPF: ממשק מודרני עבור טאבים בתוך שורת הכותרת (TabControl in TitleBar)
    pcinfogmachP pcinfogmach

    הייתי צריך ממשק מודרני עם טאבים בתוך שורת הכותרת של החלון (בדומה למה שיש בכל דפדפן אינטרנט קלאסי)

    לא מצאתי משהו לרוחי אז יצרתי משהו לעצמי
    מצו"ב הלינק לגיט למקרה שעוד מישהו מעוניין בכזה דבר
    https://github.com/pcinfogmach/ChromeTabs

    הפרוייקט לא נעשה בכל חלקיו לפי הספר ממש אבל הוא עושה את העבודה בצורה יפה.

    37ddc135-96c6-4933-a3da-4dd0fc07ed93-image.png


  • תוכנה מצוינת עם אוסף אייקונים לשימוש חינמי ב-WPF
    pcinfogmachP pcinfogmach

    אם אתם מפתחים אפליקציות ב-WPF ומחפשים אוסף אייקונים לשימוש ב-UI שלכם, מצאתי כלי מעולה שמספק אוסף גדול של אייקונים הניתנים לשימוש בקלות באמצעות תכונת ה-Path ב-XAML.

    https://apps.microsoft.com/detail/9mtbnqsz9nz9?hl=en-US&gl=US


  • המלצה על חנות ארונות זולה
    pcinfogmachP pcinfogmach

    ראיתי אתר של חנות ארונות זולה
    https://www.aluf-haronot.co.il

    מישהו יכול להמליץ לי האם כדאי לי לקנות שם?


  • קוד ללכידת מסך ב-C# WPF
    pcinfogmachP pcinfogmach

    אוקיי מצאתי איך עשים את זה

    יש מתודה ב-wpf בשם
    PointToScreen שמחשב את המיקום ביחס למסך

    עידכנתי את פוסט המקור עם התוכנה המלאה


  • קוד ללכידת מסך ב-C# WPF
    pcinfogmachP pcinfogmach

    עריכה:
    קוד \ תוכנה שפיתחתי ללכידת מסך ב-wpf
    כולל OCR של TESSERACT בעברית ובאנגלית
    https://github.com/pcinfogmach/ScreenCapture

    תודה רבה לכל העוזרים בהמשך הפוסט


  • איך להשתמש ב-pdf.js לפתיחת קבצי pdf מהמחשב ב-C#
    pcinfogmachP pcinfogmach

    בניתי תוכנה שמדגימה את הימוש בספרייה זו ב-C# למי שמעוניין להלן הקישור לגיט האב
    https://github.com/pcinfogmach/PdfJs2
    התוכנה רק מדגימה שימוש בסיס יש עוד המון אפשרויות להתממשקות דרך js


  • איך להשתמש ב-pdf.js לפתיחת קבצי pdf מהמחשב ב-C#
    pcinfogmachP pcinfogmach

    לבינתיים מצאתי פתרון לא מושלם אבל זה עובד:
    יש להעתיק את הקובץ לתוך תיקיית ה-web ומשם אפשר לפתוח אותו (עיין כאן) מצו"ב דוגמא מלאה:
    אני מקווה שאולי מישהו שמבין באמת בנושא יוכל להצביע על הפונציה הנצרכת ברור לי שיש משהו כזה כי יש כפתור שפותח קבצים.

    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            webView.CoreWebView2InitializationCompleted += Browser_CoreWebView2InitializationCompleted;
            webView.EnsureCoreWebView2Async();
        }
    
        private void Browser_CoreWebView2InitializationCompleted(object? sender, Microsoft.Web.WebView2.Core.CoreWebView2InitializationCompletedEventArgs e)
        {
            string appPath = AppDomain.CurrentDomain.BaseDirectory;
            string fullPath = Path.Combine(appPath, "pdfjs");
            webView.CoreWebView2.SetVirtualHostNameToFolderMapping("pdfjs", fullPath, CoreWebView2HostResourceAccessKind.DenyCors);
        }
    
        private void OpenPdfButton_Click(object sender, RoutedEventArgs e)
        {
            var openFileDialog = new Microsoft.Win32.OpenFileDialog
            {
                Filter = "PDF Files (*.pdf)|*.pdf",
                Title = "Select a PDF File"
            };
    
            if (openFileDialog.ShowDialog() == true)
            {
                string filePath = openFileDialog.FileName;
                string appPath = AppDomain.CurrentDomain.BaseDirectory;
                string targetPath = Path.Combine(appPath, "pdfjs", "web", Path.GetFileName(filePath));
    
                try
                {
                    // Copy the selected PDF file to the pdfjs folder
                    File.Copy(filePath, targetPath, true);
    
                    // Open the copied file in the PDF viewer
                    string fileUri = new Uri($"https://pdfjs/web/viewer.html?file={Path.GetFileName(filePath)}").AbsoluteUri;
                    webView.Source = new Uri(fileUri);;
                }
                catch (Exception ex)
                {
                    MessageBox.Show($"Error copying file: {ex.Message}");
                }
            }
        }
    }
    

  • איך להשתמש ב-pdf.js לפתיחת קבצי pdf מהמחשב ב-C#
    pcinfogmachP pcinfogmach

    במהלך חיפושי אחרי ספרייה שימושית להצגת מסמכי PDF, נתקלתי ב-pdf.js — מציג ה-PDF של פיירפוקס, שהוא גם חינמי.

    עם זאת, ישנה בעיה: בגלל הגבלות בטיחות של דפדפנים, לא ניתן לטעון את הקורא באופן ישיר. מצאתי פתרון בנושא כאן, שבו מוצע להשתמש בקוד הבא:

    private async void PDFjsViewerWebView_CoreWebView2Initialized(WebView2 sender, CoreWebView2InitializedEventArgs args)
    {
    	string path = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
    	sender.CoreWebView2.SetVirtualHostNameToFolderMapping("pdfjs", path, CoreWebView2HostResourceAccessKind.DenyCors);
    	PDFjsViewerWebView.Source = new("https://pdfjs/web/viewer.html");
    }
    

    הקוד עובד מצוין והקורא נטען בהצלחה. כעת, אני נתקלתי בבעיה — איך אני טוען מסמך לוקאלי דרך הקורא?


  • ביאור עניין ה"קבלה קטנה של עשי"ת - לתשב"ר
    pcinfogmachP pcinfogmach

    קבלה קטנה לתשבר.docx


  • שאלה / מערכת הודעות התגוננות מטעם פיקוד העורף בטכנולוגית CB
    pcinfogmachP pcinfogmach

    @אפרים22
    יש לזה הגדרה בפלאפון 4X4?


  • איפה משתמשי נטפרי יכולים להתעדכן במצב בזמן אמת?
    pcinfogmachP pcinfogmach

    @chagold
    לא מצאתי שם מידע יעיל מספיק חוץ מעל אזעקות בזמן אמת או הנחיות כלליות.
    אני מחפש מידע יותר ספיציפי נגיד היום בערב אחרי המתקפה רציתי לדעת ממתי אפשר לצאת לקניות שלוקחות זמן.
    או האם יש צפי לעוד מתקפות בחג וכו'.


  • איפה משתמשי נטפרי יכולים להתעדכן במצב בזמן אמת?
    pcinfogmachP pcinfogmach

    מישהו יודע איפה משתמשי נטפרי יכולים להתעדכן במצב ובפרט בהוראות - בזמן אמת?


  • הוצאת נתונים מדוח שעון נוכחות
    pcinfogmachP pcinfogmach

    @ששא
    אתה כתבת איזה תוצאות אתה רוצה לא איזה שלבים אתה צריך לעבור כדי להגיע לתוצאות. אני מנסה לעזור לך לחשוב - זה הסיבה שלא הצלחת כי לא ניתחת מה אתה צריך לעשות.


  • הוצאת נתונים מדוח שעון נוכחות
    pcinfogmachP pcinfogmach

    @ששא
    שלב ראשון תנסה לחשוב איך היית עושה את התרגיל באופן ידני.
    כלומר מה הם השלבים שאתה צריך לעשות כדי לקבל את התוצאה שאתה רוצה:
    איזה מידע אתה צריך לסנן לארגן ולחשב ואיך, לא כל דבר אפשר ישירות על ידי חשבון אקסל לפעמים צריך מאקרו לזה.


  • קוד עבור WPF PlaceHolder TextBox
    pcinfogmachP pcinfogmach

    מטרת הקוד הזה היא ליצור רכיב מותאם אישית של תיבת טקסט (TextBox) ב-WPF, עם תמיכה בטקסט PlaceHolder, כלומר טקסט שמופיע בתוך תיבת הטקסט כשהיא ריקה ולא ממוקדת (כלומר, המשתמש לא בחר בה עדיין). כאשר המשתמש לוחץ על תיבת הטקסט ומתחיל להקליד, PlaceHolder נעלם, וכשהתיבה ריקה והפוקוס יוצא ממנה, PlaceHolder חוזר.
    בפועל, הקוד משתמש במנגנון שנקרא Adorner כדי להציג את טקסט PlaceHolder כטקסט חיצוני מעל תיבת הטקסט, מבלי להשפיע על התוכן האמיתי שבתיבת הטקסט.

    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Documents;
    using System.Windows.Media;
    
    namespace AdvancedControls
    {
        public class PlaceHolderTextBox : TextBox
        {
            private AdornerLayer _adornerLayer;
            private PlaceholderAdorner _placeholderAdorner;
    
            #region PlaceHolder Property
            public static readonly DependencyProperty PlaceholderTextProperty = DependencyProperty.Register(
                "PlaceholderText",
                typeof(string),
                typeof(PlaceHolderTextBox),
                new PropertyMetadata(string.Empty, OnPlaceholderTextChanged));
    
            public string PlaceholderText
            {
                get => (string)GetValue(PlaceholderTextProperty);
                set => SetValue(PlaceholderTextProperty, value);
            }
    
            private static void OnPlaceholderTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
            {
                var textBox = d as PlaceHolderTextBox;
                textBox?.UpdatePlaceholderVisibility();
            }
            #endregion
    
            public PlaceHolderTextBox()
            {
                Loaded += (s, e) => InitializePlaceholder();
                TextChanged += (s, e) => UpdatePlaceholderVisibility();
                GotFocus += (s, e) => UpdatePlaceholderVisibility();
                LostFocus += (s, e) => UpdatePlaceholderVisibility();
            }
    
            private void InitializePlaceholder()
            {
                _adornerLayer = AdornerLayer.GetAdornerLayer(this);
                UpdatePlaceholderVisibility();
            }
    
            private void UpdatePlaceholderVisibility()
            {
                if (_adornerLayer == null) return;
    
                // Remove existing adorner if any
                var adorners = _adornerLayer.GetAdorners(this);
                if (adorners != null)
                {
                    foreach (var adorner in adorners)
                    {
                        if (adorner is PlaceholderAdorner)
                        {
                            _adornerLayer.Remove(adorner);
                        }
                    }
                }
    
                // Add the adorner only if the TextBox is empty and not focused
                if (string.IsNullOrEmpty(this.Text) && !this.IsFocused)
                {
                    _placeholderAdorner = new PlaceholderAdorner(this, PlaceholderText, this.FontSize);
                    _adornerLayer.Add(_placeholderAdorner);
                }
            }
        }
    
    
        public class PlaceholderAdorner : Adorner
        {
            private readonly TextBlock _placeholderTextBlock;
    
            public PlaceholderAdorner(UIElement adornedElement, string placeholderText, double fontSize) : base(adornedElement)
            {
                _placeholderTextBlock = new TextBlock
                {
                    Text = placeholderText,
                    Foreground = Brushes.Gray,
                    IsHitTestVisible = false,  // Allow clicks to pass through to the TextBox
                    FontSize = fontSize - 1,
                    Padding = new Thickness(2,0,2,0)
                };
    
                AddVisualChild(_placeholderTextBlock);
            }
    
            protected override int VisualChildrenCount => 1;
    
            protected override Visual GetVisualChild(int index) => _placeholderTextBlock;
    
            protected override Size MeasureOverride(Size constraint)
            {
                _placeholderTextBlock.Measure(constraint);
                return AdornedElement.RenderSize;
            }
    
            protected override Size ArrangeOverride(Size finalSize)
            {
                _placeholderTextBlock.Arrange(new Rect(finalSize));
                return finalSize;
            }
        }
    }
    
    

  • איך להסיר ניקוד וטעמים מטקסט בc#
    pcinfogmachP pcinfogmach

    @dovid

    יש בעיה בהסרת ניקוד וטעמים כאשר מופיע מקף עליון שצריך להחליף אותו ברוווח אחרת זה יחבר שני מילים

    הנה הקוד המתוקן עבור שימוש ב- stringbuilder

     public static string RemoveHebrewDiactrics(this string input)
     {
         var sb = new StringBuilder(input.Length);
    
         foreach (var c in input)
             
             if (c == '־')
                 sb.Append(' ');
             else if (c > 1487 || c < 1425)
    
                 sb.Append(c);
    
         return sb.ToString();
     }
    

  • מדריך: איך להציג עברית ב- C# Console APP
    pcinfogmachP pcinfogmach

    @pcinfogmach

    שימו לב! ב-.net (לא framework) יש לפעול לפי ההוראות כאן כדי להפעיל את ה-encoding שאיננו מובנה


  • vba אקסס | שמירת משתנה בקוד כל זמן ריצת האקסס
    pcinfogmachP pcinfogmach

    @אוריי
    חיפוש בגוגל הוא גם אומנות כדאי שתלמד אותה (לקח לי שלוש שניות לאתר את הפוסט הזה).
    טיפ: אחד מהנפילות של אנשים שמחפשים בגוגל הוא שהם לא מצליחים לבטאות את עצמם ומנוע החיפוש לא יכול לנחש מה הם רוצים.


  • vba אקסס | שמירת משתנה בקוד כל זמן ריצת האקסס
    pcinfogmachP pcinfogmach

    @אוריי
    https://stackoverflow.com/questions/38887379/how-to-make-a-global-variable-in-ms-access

  • 1
  • 2
  • 9
  • 10
  • 11
  • 12
  • 13
  • 34
  • 35
  • 11 / 35
  • התחברות

  • אין לך חשבון עדיין? הרשמה

  • התחברו או הירשמו כדי לחפש.
  • פוסט ראשון
    פוסט אחרון
0
  • דף הבית
  • קטגוריות
  • פוסטים אחרונים
  • משתמשים
  • חיפוש
  • חוקי הפורום