Quantcast
Channel: VBForums - WPF, WCF, WF
Viewing all 277 articles
Browse latest View live

[RESOLVED] Checkbox Data Template

$
0
0
Im changing the checkbox "checkbox" image based upon binding values triggered and all is fine but the initial image doesnt get set. It remains as a checkbox.

I think its either the trigger or not the right way to mondify this or Im missing something.

Ideas?


xaml Code:
  1. <UserControl x:Class="Dev.Views.Controls.ProgressCheckBox"
  2.              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3.              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4.              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5.              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6.              x:Name="Root"
  7.              d:DesignHeight="300"
  8.              d:DesignWidth="300"
  9.              mc:Ignorable="d">
  10.     <UserControl.Resources>
  11.         <DataTemplate x:Key="NotStartedTempalte">
  12.             <!--<RadioButton Content=""
  13.                          IsChecked="True"
  14.                          IsEnabled="False" />-->
  15.             <Path x:Name="NotStartedTempalte"
  16.                   Width="15"
  17.                   Height="15"
  18.           Margin="2"
  19.                   Stretch="Fill"
  20.                   Stroke="Black"
  21.                   StrokeThickness="1.5" >
  22.                 <Path.Data>
  23.                     <RectangleGeometry Rect="40,40 30 30" />
  24.                 </Path.Data>
  25.             </Path>
  26.         </DataTemplate>
  27.         <DataTemplate x:Key="InProgressTemplate">
  28.             <Path x:Name="ArrowPath"
  29.                   Width="30"
  30.                   Height="15"
  31.                   Data="F1 M 358.447,332.449L 358.447,319.664L 380.875,319.664L 380.798,309.408L 407.698,326.505L 381.068,343.628L 380.982,332.45L 358.447,332.449 Z "
  32.                   Stretch="Fill"
  33.                   Stroke="Black"
  34.                   StrokeThickness="2" />
  35.         </DataTemplate>
  36.         <DataTemplate x:Key="CompleteTemplate">
  37.             <Path x:Name="CheckMark"
  38.                   Width="25"
  39.                   Height="25"
  40.                   Data="M 12.4227,0.00012207C 12.4867,0.126587 12.5333,0.274536 12.6787,0.321411C 9.49199,3.24792 6.704,6.57336 4.69865,10.6827C 4.04399,11.08 3.47066,11.5573 2.83199, 11.9706C 2.09467,10.2198 1.692,8.13196 3.8147e-006, 7.33606C 0.500004,6.79871 1.31733,6.05994 1.93067,6.2428C 2.85999,6.51868 3.14,7.9054 3.60399,8.81604C 5.80133, 5.5387 8.53734,2.19202 12.4227,0.00012207 Z "
  41.                   Fill="Black"
  42.                   SnapsToDevicePixels="False"
  43.                   Stretch="Fill"
  44.                   Stroke="Black"
  45.                   StrokeThickness="1" />
  46.         </DataTemplate>
  47.         <DataTemplate x:Key="ErrorTemplate">
  48.             <Path Width="15"
  49.                   Height="15"
  50.                   Margin="2"
  51.                   Data="F1M54.0573,47.8776L38.1771,31.9974 54.0547,16.1198C55.7604,14.4141 55.7604,11.6511 54.0573,9.94531 52.3516,8.23962 49.5859,8.23962 47.8802,9.94531L32.0026,25.8229 16.1224,9.94531C14.4167,8.23962 11.6511,8.23962 9.94794,9.94531 8.24219,11.6511 8.24219,14.4141 9.94794,16.1198L25.8255,32 9.94794,47.8776C8.24219,49.5834 8.24219,52.3477 9.94794,54.0534 11.6511,55.7572 14.4167,55.7585 16.1224,54.0534L32.0026,38.1745 47.8802,54.0534C49.5859,55.7585 52.3516,55.7572 54.0573,54.0534 55.7604,52.3477 55.763,49.5834 54.0573,47.8776z"
  52.                   Fill="Red"
  53.                   RenderTransformOrigin="0.5,0.5"
  54.                   Stretch="Uniform" />
  55.         </DataTemplate>
  56.         <ControlTemplate x:Key="CheckBoxTemplate" TargetType="ContentControl">
  57.             <ContentControl Name="Content" />
  58.             <ControlTemplate.Triggers>
  59.                 <DataTrigger Binding="{Binding ProgressCheckMode, ElementName=Root}" Value="Complete">
  60.                     <Setter TargetName="Content" Property="ContentTemplate" Value="{StaticResource CompleteTemplate}" />
  61.                 </DataTrigger>
  62.                 <DataTrigger Binding="{Binding ProgressCheckMode, ElementName=Root}" Value="InProgress">
  63.                     <Setter TargetName="Content" Property="ContentTemplate" Value="{StaticResource InProgressTemplate}" />
  64.                 </DataTrigger>
  65.                 <DataTrigger Binding="{Binding ProgressCheckMode, ElementName=Root}" Value="NotStarted">
  66.                     <Setter TargetName="Content" Property="ContentTemplate" Value="{StaticResource NotStartedTempalte}" />
  67.                 </DataTrigger>
  68.                 <DataTrigger Binding="{Binding ProgressCheckMode, ElementName=Root}" Value="Error">
  69.                     <Setter TargetName="Content" Property="ContentTemplate" Value="{StaticResource ErrorTemplate}" />
  70.                 </DataTrigger>
  71.                 <DataTrigger Binding="{Binding IsRunning, ElementName=Root}" Value="False">
  72.                     <Setter Property="Visibility" Value="Hidden" />
  73.                 </DataTrigger>
  74.             </ControlTemplate.Triggers>
  75.         </ControlTemplate>
  76.  
  77.         <Style x:Key="CheckboxVisibilityStyle" TargetType="RadioButton">
  78.             <Style.Triggers>
  79.                 <DataTrigger Binding="{Binding IsRunning, ElementName=Root}" Value="True">
  80.                     <Setter Property="Visibility" Value="Collapsed" />
  81.                 </DataTrigger>
  82.             </Style.Triggers>
  83.         </Style>
  84.     </UserControl.Resources>
  85.     <Grid>
  86.         <Grid.ColumnDefinitions>
  87.             <ColumnDefinition Width="40" />
  88.             <ColumnDefinition />
  89.         </Grid.ColumnDefinitions>
  90.         <RadioButton HorizontalAlignment="Center"
  91.                      VerticalAlignment="Center"
  92.                      IsChecked="False"
  93.                      Style="{StaticResource CheckboxVisibilityStyle}" />
  94.         <ContentControl Grid.Column="0"
  95.                         HorizontalAlignment="Center"
  96.                         VerticalAlignment="Center"
  97.                         Template="{StaticResource CheckBoxTemplate}" />
  98.         <TextBlock Grid.Column="1"
  99.                    HorizontalAlignment="Left"
  100.                    VerticalAlignment="Center"
  101.                    Text="{Binding Text,
  102.                                   ElementName=Root}" />
  103.     </Grid>
  104. </UserControl>
Attached Images
   

Problems adding rows to a DataGrid

$
0
0
To start with, I am using VS2012 and .NET 4.5.

I am binding a DataGrid to an ObservableCollection<DataItem> and want to allow in-grid editing. I have CanUserAddRows and CanUserDeleteRows set to true. When I bind the DataGrid to the collection, the data displays perfectly (only one column of the class visible, the rest can be filled in programmatically), along with a {NewItemPlaceholder} row. I can edit existing rows and it works fine, but when I attempt to add a new row by moving to the placeholder, entering a value, and then hitting enter, nothing happens. That is, the new value is displayed, but the AddingNewItem event never fires, the new row isn't added to the underlying collection, and no new {NewItemPlaceholder} row is added to the DataGrid.

I'm probably doing (or, more accurately, NOT doing) something stupid, but I haven't done a lot of work with DataGrids, so I'm looking for a hand.

Do I have to manually implement the add functionality? If so, is there a built-in event to tell me when to do that, or do I have to do something kludgy like trap the enter key and use that to fire the manual add functionality? Or am I just missing something fairly simple?

How to find parent of selected item in TreeView?

$
0
0
Okay, using Windows 7 with VS2012 and .NET 4.5 in a WPF application, I have a multi-level treeview that looks like this:

Name:  TreeView.jpg
Views: 116
Size:  7.4 KB

The TreeView is bound to an observable collection of the codes. What I want SHOULD be simple, but it's not turning out to be so. Let's assume that the user clicks on the "6010F-8P" item... how can I find the parent item ("6015F-00")? The data can be up to four levels deep, and I need to be able to backtrack up the entire chain to find not only the root item, but also each parent along the way.

I have searched and searched, but can't find any way to do this. Is there any way for the TreeView control to do find the parent item of a selected item?

Thanks in advance...
Attached Images
 

[RESOLVED] Multi Color XAML Images/Icons

$
0
0
So got the need to add a warning image to our app and sure is easy with Metro Studio but how can I use more than one color in the xml Path Data?

I have the yellow warning triangle image with teh exclamation point inside it but the exclamation point is transparent. I want it to be black and still have the background retain its transparency.

Thanks

Example of the xaml


Code:

<Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
  <Grid>
    <Grid Name="backgroundGrid" Width="48" Height="48" Visibility="Collapsed" />
    <Path Data="F1M874.094,289.369L854.3,254.63C854.028,254.151 853.515,253.856 852.958,253.856 852.403,253.856 851.89,254.151 851.617,254.63L831.824,289.369C831.555,289.84 831.559,290.416 831.835,290.883 832.111,291.348 832.618,291.634 833.165,291.634L872.752,291.634C873.299,291.634 873.805,291.348 874.081,290.883 874.357,290.416 874.361,289.84 874.094,289.369 M855.653,287.189L850.264,287.189 850.264,282.745 855.653,282.745 855.653,287.189z M855.653,279.41L850.264,279.41 850.264,266.077 855.653,266.077 855.653,279.41z" Stretch="Uniform" Fill="#FFFCCE00" Width="48" Height="48" Margin="0,0,0,0" RenderTransformOrigin="0.5,0.5">
      <Path.RenderTransform>
        <TransformGroup>
          <TransformGroup.Children>
            <RotateTransform Angle="0" />
            <ScaleTransform ScaleX="1" ScaleY="1" />
          </TransformGroup.Children>
        </TransformGroup>
      </Path.RenderTransform>
    </Path>
  </Grid>
</Viewbox>

Attached Images
 

NamedPipeServerStream vs WCF

$
0
0
I have a scenario regarding these two technologies. I am building an API where there is a transactional piece that can be used in a client.exe while there's a data piece that gets loaded into a third party exe. I've been working with WCF as the messaging communication means between the two. Basically it just needs to communicate requests to read with the entity data read from the third party exe returned or communicate the need to commit data changes to the third party exe. In either case, custom object data needs to be passed back and forth. Conceptually the idea is very simple since my current WCF service doesn't have to do much more than pass data back and forth regarding a specific request (Write/Read). I just found out about NamedPipeServerStreams today though and it seems to be a very direct and simple approach... I think anyways... Since this is communications internal to an API, it seems to make more sense than WCF, but to be honest I'm ignorant about what makes the two different and whether or not it really would be best in this scenario. Being that this is an API, communications on the same machine or across the network between two processes is acceptable. If I needed to go beyond this, I would wrap API transaction calls with a WCF http configuration for sure.

Now that you have an idea of where I'm coming from, my questions are:
  • What's the difference between the two?
  • Does this seem to be an application more fitting to one or the other?
  • If not, what are the best fits for NamedPipeServerStream over WCF?


I just want to make sure before I go any deeper whether I should be switching to NamedPipeServerStream or stay the direction of WCF.

Finding minimum and convert it to zero in datagrid

$
0
0
Good evening..I have a question how can I get the minimum value of a column1 and that minimum change to zero?

Example input
2
5
10
2
Answer
0
5
10
0

WCF Webhook Service, How to convert POST stream to data array?

$
0
0
Good afternoon, I am attempting to build a WCF service that will listen for a webhook call from as website, in my case www.formstack.com. I am able to get the WCF service working and accepting data but the stream is being returned as a long URL formatted text string instead of XML.

This is what is being returned. I ultimately need this into a format that I can then submit it to a database.
Quote:

FormID=1730225&UniqueID=166942101&Ticket+Number=&System+Number=&Customer+Number=&Customer+Name=&Your +Name=Brad+Swindell&Email=&Score=10+-+Very+Likely&Additional+Feedback=This+is+%22A+Test%22%2C+that+has+%3D+and+%26+symbol%27s+in+it.&Woul d+you+like+this+survey+to+be+anonymous%3F=No&Tech=&Id=
I could try to parse the text by & and = and then replace the +. but I would have to trap every other symbol. Is there a better way to approach this issue?
Code:

Public Function PostSampleMethod(data As Stream) As String Implements IMyService.PostSampleMethod
        Dim reader As New StreamReader(data)
        Dim xmlString As String = reader.ReadToEnd()

        Using w As StreamWriter = File.AppendText("C:\log.txt")
            Log(xmlString, w)
        End Using

        Return Nothing
End Function

Formstack Webhook API - https://www.formstack.com/developers/webhooks

I was wondering if VB.Net has a library that can handle this process or if I am going about getting the data from the POST the wrong way?

Any help would be appreciated.

Thanks guys for the help.

Brad Swindell
Attached Files

WPF making Chart

$
0
0
Hello,

I'm here because I'm looking for an example to plot points with lines in a chart. I have tried Oxyplot, Sparrow Toolkit and I finaly concluded that every example is in C#. And no or very few documentation is available.

Could someone give me an example of VB.Net code and xaml with a chart toolkit please? My code should receive from a function the value of Y axis by giving the X. Of course it will be in a loop to get a real function line.

Thank you very much :)

[RESOLVED] WCF Webhook Service, How to convert POST stream to data array?

$
0
0
Good afternoon, I am attempting to build a WCF service that will listen for a webhook call from as website, in my case www.formstack.com. I am able to get the WCF service working and accepting data but the stream is being returned as a long URL formatted text string instead of XML.

This is what is being returned. I ultimately need this into a format that I can then submit it to a database.
Quote:

FormID=1730225&UniqueID=166942101&Ticket+Number=&System+Number=&Customer+Number=&Customer+Name=&Your +Name=Brad+Swindell&Email=&Score=10+-+Very+Likely&Additional+Feedback=This+is+%22A+Test%22%2C+that+has+%3D+and+%26+symbol%27s+in+it.&Woul d+you+like+this+survey+to+be+anonymous%3F=No&Tech=&Id=
I could try to parse the text by & and = and then replace the +. but I would have to trap every other symbol. Is there a better way to approach this issue?
Code:

Public Function PostSampleMethod(data As Stream) As String Implements IMyService.PostSampleMethod
        Dim reader As New StreamReader(data)
        Dim xmlString As String = reader.ReadToEnd()

        Using w As StreamWriter = File.AppendText("C:\log.txt")
            Log(xmlString, w)
        End Using

        Return Nothing
End Function

Formstack Webhook API - https://www.formstack.com/developers/webhooks

I was wondering if VB.Net has a library that can handle this process or if I am going about getting the data from the POST the wrong way?

Any help would be appreciated.

Thanks guys for the help.

Brad Swindell
Attached Files

Using WPF Controls in Windows Forms

$
0
0
Hello,

I am trying to make a video player in Visual Basic.NET (visual studio 2012) without using the built in Windows media player.
I saw somewhere that you can create a WPF user control with a MediaElement and then use that in a Windows Form.

Unfortunately i have had very little success in creating my own working control.

I made a WPF User Control Library and made a new user control there with the MediaElement, then proceeded with a Windows Form and placed the MediaElement on it, now comes my problem.
I cannot seem to access the properties of my MediaElement or i am trying in the wrong way.
In particular the source property to add a URI so i can actually play a movie file.

Even when i am trying to access these from .xaml.vb it seems i am doing something wrong.

So i am hoping if someone could show me/tell me exactly what i should be doing to make this work (yes sounds lazy but i swear im not)

I don't have a lot of experience with WPF yet.

Just to tell you what i did.
  • Made project - WPF control Library
  • Added New control
  • Placed a MediaElement on the grid
  • Built the project
  • Made a project for my windows forms
  • Dragged the MediaElement on the form
  • Added a menu bar with some code to open a dialog to select a movie file
  • Attempting to add the movie file to MediaElement source as URI


I have tried every namespace i think makes sense to access the source property but i must be doing something wrong.

ListView with 2 Columns (1st Col Image,2nd String), Help

$
0
0
Dear Master/Experts.

Please help me, I am newbie to WPF, I am using VB.NET to create application to show pictures from folder chosen by user. on Form I put Button (press to choose folder), Image (to show image chosen from ListView), ListView (2 columns with 1st column image thumbnail and 2nd column the filename).
Please check my XAML code below :

Code:

<Window
    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" x:Class="MainWindow"
    Title="MainWindow" Height="448.545" Width="698.135">
    <Grid>
        <Image x:Name="ImgView" Margin="259,44,10,72"/>
        <Button Content="Pilih Folder" HorizontalAlignment="Left" Height="29" Margin="10,10,0,0" VerticalAlignment="Top" Width="92" Click="Button_Click"/>
        <ListView x:Name="ListView1" HorizontalAlignment="Left" Height="351" Margin="10,44,0,0" VerticalAlignment="Top" Width="244">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="Gbr" DisplayMemberBinding="{Binding Gambar}"/>
                    <GridViewColumn Header="Nama File" DisplayMemberBinding="{Binding NamaFile}"/>
                </GridView>
            </ListView.View>
        </ListView>

    </Grid>
</Window>

And here is my code

Code:

Imports System.Windows.Forms
Imports System.Collections.ObjectModel

Class MainWindow

    Private _GbrCollection As New ObservableCollection(Of GambarCol)

    Public ReadOnly Property GbrCollection() As ObservableCollection(Of GambarCol)
        Get
            Return _GbrCollection
        End Get
    End Property

    Private Sub MainWindow_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
        InitializeComponent()
    End Sub

    Private Sub Button_Click(sender As Object, e As RoutedEventArgs)
        Dim ImgList() As Image
        Dim Img88 As Image
        Dim fld As New FolderBrowserDialog
        Dim iCnt As Integer

        fld.RootFolder = Environment.SpecialFolder.Desktop
        'fldDialog.RootFolder = Environment.SpecialFolder.Desktop;
        fld.ShowDialog()
        'txtPath.Text = fld.SelectedPath

        'filesListBox.Items.Clear()

        Dim fileNames = My.Computer.FileSystem.GetFiles(fld.SelectedPath, FileIO.SearchOption.SearchTopLevelOnly, "*.jpg")
        'Debug.WriteLine(fileNames.Count)
        ReDim ImgList(fileNames.Count)
        lstbox.Items.Clear()

        For Each fileName As String In fileNames
            _GbrCollection.Add(New GambarCol(Img88, fileName))
        Next

        ListView1.ItemsSource = GbrCollection
    End Sub

    Private Sub ListView1_MouseDoubleClick(sender As Object, e As MouseButtonEventArgs) Handles ListView1.MouseDoubleClick
        Dim ImgShow As New Image
        'ImgShow.Source = New BitmapImage(New System.Uri(ListView1.Items))
    End Sub
    Private Sub ListView1_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles ListView1.SelectionChanged

    End Sub
End Class
Public Class GambarCol
    Private _Gambar As Image
    Private _NamaFile As String

    Public ReadOnly Property Gambar() As Image
        Get
            _Gambar = New Image
            _Gambar.Source = New BitmapImage(New System.Uri(NamaFile))
            _Gambar.Height = 60
            Return _Gambar
        End Get
    End Property

    Public ReadOnly Property NamaFile() As String
        Get
            Return _NamaFile
        End Get
    End Property

    Public Sub New(ByVal GbrImg As Image, ByVal NamaFileNF As String)
        _Gambar = GbrImg
        _NamaFile = NamaFileNF
    End Sub
End Class

Master, help me solve 3 problems :
1. Image can't be shown in column 1 in Listview
2. How to get value from column 2 when user double click the row
3. I know my code too complicated , can someone help me to make it simple

Really Really need help

Thank you very much

Error setting background image in WPF using Visual Basic, Visual Basic Studio

$
0
0
Hi everybody,

I get this error message trying to set a background image for my WPF using Visual Basic in Visual Studio 2013 Express:

"An unhandled exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll

Additional information: 'Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '7' and line position '14'.

If there is a handler for this exception, the program may be safely continued."

Here is the XAML:

<Window x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Grid.Background>
<ImageBrush ImageSource="space.jpg"/>
</Grid.Background>

</Grid>
</Window>

I don't understand what's wrong...

Change WPF Window Border to Black - VB Studio

$
0
0
Hey everybody,

I am reading that I will need to implement some 3rd Party programming to change the color of the window border of my WPF to black, because the window border is non-client.

Is there a simple walkthrough to doing this?

Does anyone recommend an IDE where user interface is highly customizable? I am having a hard time since I am knew to this, and am still get used to how to use VB and WPF in general...

[RESOLVED] ListView with 2 Columns (1st Col Image,2nd String), Help

$
0
0
Dear Master/Experts.

Please help me, I am newbie to WPF, I am using VB.NET to create application to show pictures from folder chosen by user. on Form I put Button (press to choose folder), Image (to show image chosen from ListView), ListView (2 columns with 1st column image thumbnail and 2nd column the filename).
Please check my XAML code below :

Code:

<Window
    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" x:Class="MainWindow"
    Title="MainWindow" Height="448.545" Width="698.135">
    <Grid>
        <Image x:Name="ImgView" Margin="259,44,10,72"/>
        <Button Content="Pilih Folder" HorizontalAlignment="Left" Height="29" Margin="10,10,0,0" VerticalAlignment="Top" Width="92" Click="Button_Click"/>
        <ListView x:Name="ListView1" HorizontalAlignment="Left" Height="351" Margin="10,44,0,0" VerticalAlignment="Top" Width="244">
            <ListView.View>
                <GridView>
                    <GridViewColumn Header="Gbr" DisplayMemberBinding="{Binding Gambar}"/>
                    <GridViewColumn Header="Nama File" DisplayMemberBinding="{Binding NamaFile}"/>
                </GridView>
            </ListView.View>
        </ListView>

    </Grid>
</Window>

And here is my code

Code:

Imports System.Windows.Forms
Imports System.Collections.ObjectModel

Class MainWindow

    Private _GbrCollection As New ObservableCollection(Of GambarCol)

    Public ReadOnly Property GbrCollection() As ObservableCollection(Of GambarCol)
        Get
            Return _GbrCollection
        End Get
    End Property

    Private Sub MainWindow_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
        InitializeComponent()
    End Sub

    Private Sub Button_Click(sender As Object, e As RoutedEventArgs)
        Dim ImgList() As Image
        Dim Img88 As Image
        Dim fld As New FolderBrowserDialog
        Dim iCnt As Integer

        fld.RootFolder = Environment.SpecialFolder.Desktop
        'fldDialog.RootFolder = Environment.SpecialFolder.Desktop;
        fld.ShowDialog()
        'txtPath.Text = fld.SelectedPath

        'filesListBox.Items.Clear()

        Dim fileNames = My.Computer.FileSystem.GetFiles(fld.SelectedPath, FileIO.SearchOption.SearchTopLevelOnly, "*.jpg")
        'Debug.WriteLine(fileNames.Count)
        ReDim ImgList(fileNames.Count)
        lstbox.Items.Clear()

        For Each fileName As String In fileNames
            _GbrCollection.Add(New GambarCol(Img88, fileName))
        Next

        ListView1.ItemsSource = GbrCollection
    End Sub

    Private Sub ListView1_MouseDoubleClick(sender As Object, e As MouseButtonEventArgs) Handles ListView1.MouseDoubleClick
        Dim ImgShow As New Image
        'ImgShow.Source = New BitmapImage(New System.Uri(ListView1.Items))
    End Sub
    Private Sub ListView1_SelectionChanged(sender As Object, e As SelectionChangedEventArgs) Handles ListView1.SelectionChanged

    End Sub
End Class
Public Class GambarCol
    Private _Gambar As Image
    Private _NamaFile As String

    Public ReadOnly Property Gambar() As Image
        Get
            _Gambar = New Image
            _Gambar.Source = New BitmapImage(New System.Uri(NamaFile))
            _Gambar.Height = 60
            Return _Gambar
        End Get
    End Property

    Public ReadOnly Property NamaFile() As String
        Get
            Return _NamaFile
        End Get
    End Property

    Public Sub New(ByVal GbrImg As Image, ByVal NamaFileNF As String)
        _Gambar = GbrImg
        _NamaFile = NamaFileNF
    End Sub
End Class

Master, help me solve 3 problems :
1. Image can't be shown in column 1 in Listview
2. How to get value from column 2 when user double click the row
3. I know my code too complicated , can someone help me to make it simple

Really Really need help

Thank you very much

List problem

$
0
0
I have a combo box that will be populated in a FlexiGrid when a form loads up. However on the program I am making, the item selected from the drop down box can only be used once. So I need to somehow update the list as one item is selected, removing it from the list so that then populates the next combo box without the selected items in it to prevent users from selecting the same item twice.

So for example the following items are populated in the combo box from a Stored Procedure from a SQL Database:
'Controller'
'Book'
'Tv'

So say if Row 1 the user has selected from the combo box a 'Controller', the list then removes this item from it and then whatever is left gets populated in the list again.

I have tried a for each loop that ran through the rows in the flexigrid but I just kept hitting a brick wall and getting nowhere.

It seems pretty confusing. It's difficult to explain haha.

But thanks for any possible help!

How do I?: Tabbed MDI application in WPF and VB 2010.

$
0
0
I've just recently switched from WinForms to WPF after studying the "vast" advantages WPF has over WinForms. I've also learned to use Microsoft Expression Blend 4. I'm also learning MVVM.

I wish to create a Data Client application in WPF (and VB 2010 which i know quite well) which runs on Windows 7 machines that accesses an SQL Server 2005 database on a Windows Server 2003 machine, in a LAN or/and WLAN environment. The application must be resolution independent (hence WPF). It must also be a Tabbed MDI application with tool-windows and MDI child-windows that can be docked in the application's workspace as in Visual Studio 2010 and Microsoft Access 2010 (without the ribbon).

In my googling and searching Visual Studio Gallery, I found tools from Actipro, DevExpress and SandDock which can perform exactly what I need and more, however, they are all trial versions that expire in 30 days and require that I purchase serial keys for the full versions. The problem is that I am in West Africa where credit cards and paypal don't function.

I would therefore want to know if its possible of me to create my Tabbed MDI application from scratch. I may need the XAML and VB code for at least the MDI parent and dockable MDI child and tool windows.

Vector graphic from xaml resource file

$
0
0
Sure its something simple but needs to be done a certain way.

I want to use a resource file and add an entry for a vectorized icon graphic to use as my notifyicon icon.

Here is my vectorized icon data:
Code:

<Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
  <Grid>
    <Path Data="F1M183.025,3329.47L183.025,3337.06 177.917,3337.06 177.917,3329.68C173.181,3329.66,168.773,3328.59,164.689,3326.46L164.689,3316.77C166.044,3317.87 168.062,3318.88 170.744,3319.82 173.427,3320.75 175.818,3321.28 177.917,3321.42L177.917,3308.69C172.458,3306.66 168.732,3304.46 166.737,3302.09 164.742,3299.72 163.745,3296.84 163.745,3293.43 163.745,3289.77 165.039,3286.65 167.63,3284.07 170.219,3281.49 173.648,3279.99 177.917,3279.57L177.917,3273.07 183.025,3273.07 183.025,3279.43C187.947,3279.67,191.622,3280.46,194.048,3281.81L194.048,3291.26C190.782,3289.28,187.109,3288.06,183.025,3287.62L183.025,3300.88C188.135,3302.73 191.797,3304.83 194.012,3307.2 196.228,3309.57 197.337,3312.43 197.337,3315.79 197.337,3319.66 196.102,3322.78 193.63,3325.15 191.155,3327.52 187.622,3328.96 183.025,3329.47z M177.917,3298.85L177.917,3287.76C174.673,3288.35 173.054,3290.04 173.054,3292.84 173.054,3295.24 174.673,3297.24 177.917,3298.85z M183.025,3310.68L183.025,3321.28C186.361,3320.77 188.031,3319.1 188.031,3316.28 188.031,3313.99 186.361,3312.13 183.025,3310.68z" Stretch="Uniform" Fill="#FF007C30" Width="12" Height="12" Margin="0,0,0,0" RenderTransformOrigin="0.5,0.5">
      <Path.RenderTransform>
        <TransformGroup>
          <TransformGroup.Children>
            <RotateTransform Angle="0" />
            <ScaleTransform ScaleX="1" ScaleY="1" />
          </TransformGroup.Children>
        </TransformGroup>
      </Path.RenderTransform>
    </Path>
  </Grid>
</Viewbox>

And I need to set my dynamically created (using the Forms reference) notifyicon's icon to it.

Whats the proper tag structure for it?

Tried using a DrawImage but isnt correct.

Currently using a embedded resource icon but just for kicks like to change it over to the xaml resource file

Thanks

SOLVED: Hide/Close one .Xaml, and load another...Easy right?

$
0
0
Hi all,

First post here and I've looked all over for an answer.

One of two things in happening, i'm not finding what I need, or I'm not understanding what I am finding.


So, I start my Application. I get to a menu. Whichever button I click (save for the exit button... which I've managed to work out), I need to hide/close the menu (not sure which is the better option there), and launch another .xaml window. I cannot, for love nor money, figure this out.

I've some experience quite a while back with VB and Winforms... but for my new project I thought I'd give WPF a go... and so far I'm stumped...

I've seen some references to declaring windows as variables, if this is the case, where would I do this, can could someone shed some light with a code breakdown for me?

I'm using VS 2013.
I'm sorry for such a rookie question :-(


Darth269.

[RESOLVED] Help WPF Slide Transition Effect between Views

$
0
0
Hi master

I know WPF doesn't support MDI anymore, and I know you need to build from scratch.
Trick to implement MDI is by using change view for each MDI child form.

I know by using transition slide you can change view on MainForm.Xml
And I know a lot of reference in internet about this subject, but I couldn't find anywhere which using VB.NET as sample project
Can someone give me example on how make slide transition effect for change view but in VB.NET language ?
I heard Fluidkit plugin support for this transition effect, but still in C# language which I am not familiar

Thank you

Regards

Hosting WCF on internet

$
0
0
Hi ,
Anyone recommend a good company that offers hosting WCF service(framework 4.5) ?
Viewing all 277 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>