|
I took the Separator elements out. Those horizontal lines just look like a kludge.
|
|
|
|
|
fjparisIII wrote: I took the Separator elements out.
Why would you take the separator elements out if you want separators?
I gave you two working examples - one that you can totally customize
the style of the separators, and another that uses the default style.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: Why would you take the separator elements out if you want separators?
I gave you two working examples - one that you can totally customize
the style of the separators, and another that uses the default style.
I took them out before I saw your examples. After I saw your second example, I put them back in. Now they look great. Thanks for your attention.
|
|
|
|
|
*Edit*
With your Separators wrapped in StatusBarItem, they default to a horizontal orientation, so
you'd need to give your separators a vertically oriented style, otherwise you can't see them...
<StatusBar Grid.Row="1"
DockPanel.Dock="Bottom"
Height="23"
VerticalAlignment="Bottom"
BorderBrush="Black"
BorderThickness="0,.5,0,0" >
<StatusBar.ItemsPanel>
<ItemsPanelTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
</Grid>
</ItemsPanelTemplate>
</StatusBar.ItemsPanel>
<StatusBarItem Grid.Column="0" >
<TextBlock Text="TextBlock 1" Name="statusBarHelp" />
</StatusBarItem>
<StatusBarItem Grid.Column="1" >
<Separator >
<Separator.Style>
<Style TargetType="{x:Type Separator}">
<Setter Property="Height" Value="20"/>
<Setter Property="Margin" Value="2,0,2,0"/>
<Setter Property="Focusable" Value="false"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Separator}">
<Border BorderBrush="LightSlateGray" BorderThickness="1"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Separator.Style>
</Separator>
</StatusBarItem>
<StatusBarItem Grid.Column="2" HorizontalContentAlignment="Center" >
<TextBlock Text="TextBlock 2" Name="statusBarFullPath" />
</StatusBarItem>
<StatusBarItem Grid.Column="3" >
<Separator >
<Separator.Style>
<Style TargetType="{x:Type Separator}">
<Setter Property="Height" Value="20"/>
<Setter Property="Margin" Value="2,0,2,0"/>
<Setter Property="Focusable" Value="false"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Separator}">
<Border BorderBrush="LightSlateGray" BorderThickness="1"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Separator.Style>
</Separator>
</StatusBarItem>
<StatusBarItem Grid.Column="4" >
<TextBlock Text="TextBlock 3" Name="imageCount" />
</StatusBarItem>
</StatusBar>
In my second reply is a simpler version with the StatusBarItem wrappers removed.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
modified on Sunday, June 21, 2009 5:06 PM
|
|
|
|
|
Shouldn't that style then be a template, so it gets reused ? :P
OK, so a seperator is invisible without a style ? I've never used one, so I had no idea about that.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
|
Christian Graus wrote: Shouldn't that style then be a template, so it gets reused ?
That exercise is left to the reader
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
To use the default Separator style, remove the StatusBarItem
wrappers from the Separators:
<StatusBar Grid.Row="1"
DockPanel.Dock="Bottom"
Height="23"
VerticalAlignment="Bottom"
BorderBrush="Black"
BorderThickness="0,.5,0,0" >
<StatusBar.ItemsPanel>
<ItemsPanelTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
<ColumnDefinition Width="Auto"></ColumnDefinition>
</Grid.ColumnDefinitions>
</Grid>
</ItemsPanelTemplate>
</StatusBar.ItemsPanel>
<StatusBarItem Grid.Column="0" >
<TextBlock Text="TextBlock 1" Name="statusBarHelp" />
</StatusBarItem>
<Separator Grid.Column="1" />
<StatusBarItem Grid.Column="2" HorizontalContentAlignment="Center" >
<TextBlock Text="TextBlock 2" Name="statusBarFullPath" />
</StatusBarItem>
<Separator Grid.Column="3" />
<StatusBarItem Grid.Column="4" >
<TextBlock Text="TextBlock 3" Name="imageCount" />
</StatusBarItem>
</StatusBar>
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Okay, now we're talking. Good answer. Thanks, Mark. Looks good. I just make them invisible when the middle TextBlock is empty. Sure was a lot of screwing around for a lousy pair of Separator elements.
|
|
|
|
|
Hi,
I am working on a WPF application. In this I need to find the temporary drives created i.e., like drives created when some mobile or pen drive are created. From this Temporary drive created I need to get the image files.
If any one have any idea to get the names or path of the temparory drives created please reply me.
Thanks in advance.
|
|
|
|
|
|
|
Please don't create a new account. You're the only person on EARTH who thinks it's wise to mix a 'browser application' ( i.e. you will put a web browser control in a window ), with a database.
CBenac wrote: Data Source=TOSHIBA_PC\SQLEXPRESS
Is this your local machine ? Have you tried logging in with a username and password ? Have you googled the error message to see possible solutions ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
|
A WPF browser application runs in the browser ? I would assume that the issue is the application being sandboxed then.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I'm sorry if I misunderstood you at first, someone else has been posting about a browser application in WPF, and asking the same thing for days. I am trying to help you here, there's no need to delete your posts, or feel unwelcome. I am sorry for the misunderstanding, I do suspect that you're saying the app is running inside your browser, and that sandboxing is why you can't access a local DB, but you can probably access a network one. Have you had any luck with that avenue ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
There is a sample application that uses the DataGrid (from the WPF Toolkit) and displays the customers table from the NorthWind database. It runs fine if it is created as an EXE which is the original intention of the author. However, since I need the application to run in the browser, I recreate the same project as a XPAP but the browser displays the bellow error message (snipet) from the "More information" link. It appears to be a connection issue with the database. I'm using Windows authentication mode.
>>
..
The action that failed was:
Demand
The type of the first permission that failed was:
System.Data.SqlClient.SqlClientPermission
The first permission that failed was:
<IPermission class="System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
AllowBlankPassword="False">
<add ConnectionString="Data Source=TOSHIBA_PC\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True"
KeyRestrictions=""
KeyRestrictionBehavior="AllowOnly"/>
</IPermission>
.....
>>
The sample code was retrieved from here:
http://www.codeproject.com/KB/WPF/WPFDataGridExamples.aspx
|
|
|
|
|
OK - well, if you're in the browser, then I assume you're serving your app over the web. You're going to need a connection string that connects to a remote machine, not one that relies on Windows security, because the browser is sandboxed from the rest of the machine. It's basically the security in the browser that is hitting you. Have you tried using a username/password to connect to the DB ?
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I changed from Windows to SQL Server authentication and logged as User: sa and the password, but it didn't make any difference. I'll look into this remote machine you mentioned. But any additional sugestion is welcomed. It is surprise to me the few online documentation regarding WPF.
Thanks so far for your input.
|
|
|
|
|
Christian,
I changed the properties of the application to "Full trusted site" and it worked nicely
Thanks for your help
CBenac
|
|
|
|
|
|
You need to remember the size of the image itself, then you need to calculate the size of the canvas and work out a ratio to calculate a pixel position. If the aspect ratio is different, you need to work out if you use the width or the height to calculate position, and if you did any centring of the image, you need to calculate that offset, too.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
|
Welcome to hell. Width is the one you can set, but ActualWidth is the one that contains the width of the control. I believe the idea is, you can set what width you want, but you're not necessarily going to get it. I've had trouble, for example, placing an image in a grid. If they grid has no explicit size, even if it's told to stretch itself, you can put a BitmapImage in the Image, you can even set the Width of the Image, and the Height, but ActualWidth will stay zero.
ActualWidth is the one that you always use to know what the Width is.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|