Click here to Skip to main content
15,901,205 members
Home / Discussions / C#
   

C#

 
GeneralRe: is this good C# linq to sql code? Pin
Not Active13-Nov-11 13:49
mentorNot Active13-Nov-11 13:49 
GeneralRe: is this good C# linq to sql code? Pin
SledgeHammer0113-Nov-11 13:59
SledgeHammer0113-Nov-11 13:59 
GeneralRe: is this good C# linq to sql code? Pin
Not Active13-Nov-11 14:05
mentorNot Active13-Nov-11 14:05 
GeneralRe: is this good C# linq to sql code? Pin
SledgeHammer0113-Nov-11 14:27
SledgeHammer0113-Nov-11 14:27 
GeneralRe: is this good C# linq to sql code? Pin
BobJanova13-Nov-11 22:30
BobJanova13-Nov-11 22:30 
AnswerRe: is this good C# linq to sql code? Pin
omidh200713-Nov-11 11:58
omidh200713-Nov-11 11:58 
QuestionWinForms - Zoom In/Out (MS Word-Style) Pin
Matt U.12-Nov-11 6:46
Matt U.12-Nov-11 6:46 
AnswerRe: WinForms - Zoom In/Out (MS Word-Style) Pin
Alisaunder13-Nov-11 2:30
Alisaunder13-Nov-11 2:30 
I am using scaling to perform what you are wanting.

First create your slider in Xaml.
HTML
<StackPanel Orientation="Horizontal" x:Name="StatusBarSlider">
     <TextBlock Foreground="#FF9585b9" Name="StatusBarItem" Margin="0,1,0,1" Padding="6,0,6,0" Text="{Binding ElementName=scaleSlider, Path=Value, Converter={StaticResource PercentageConverter}, ConverterParameter=%}" />
     <RepeatButton Margin="1,0,1,0" CommandTarget="{Binding ElementName=scaleSlider}" ribbon:ScreenTipService.ScreenTipHeader="Zoom Out" Style="{StaticResource {x:Static ribbon:RibbonStyles.StatusBarSliderDecreaseButtonKey}}"/>
     <Slider x:Name="scaleSlider" Width="100" Value="1.0" Minimum="0.5" Maximum="2.0" LargeChange="0.5" SmallChange="0.1" VerticalAlignment="Center" IsSnapToTickEnabled="True" TickFrequency="0.1" ribbon:ScreenTipService.ScreenTipHeader="Zoom" />
     <RepeatButton Margin="1,0,1,0" CommandTarget="{Binding ElementName=scaleSlider}" ribbon:ScreenTipService.ScreenTipHeader="Zoom In" Style="{StaticResource {x:Static ribbon:RibbonStyles.StatusBarSliderIncreaseButtonKey}}"/>
</StackPanel>


Then I use this for the code controlling the slider.

C#
// preparing tab content slider transformation
ScaleTransform scaleTransform = new ScaleTransform();
Binding scaleXBinding = new Binding("Value");
scaleXBinding.Source = scaleSlider;
Binding scaleYBinding = new Binding("Value");
scaleYBinding.Source = scaleSlider;

// binding main form slider to tab content
BindingOperations.SetBinding(scaleTransform, ScaleTransform.ScaleXProperty, scaleXBinding);
BindingOperations.SetBinding(scaleTransform ScaleTransform.ScaleYProperty, scaleYBinding);

Contact2.LayoutTransform = scaleTransform;


Contact2 being the name of the form in which you wish to rescale.

I hope this helps. There are probably more efficient ways to achieve the same thing but this is what I did and it works perfectly fine. Wink | ;)
GeneralRe: WinForms - Zoom In/Out (MS Word-Style) Pin
loyal ginger13-Nov-11 2:39
loyal ginger13-Nov-11 2:39 
GeneralRe: WinForms - Zoom In/Out (MS Word-Style) Pin
Alisaunder13-Nov-11 2:41
Alisaunder13-Nov-11 2:41 
AnswerRe: WinForms - Zoom In/Out (MS Word-Style) Pin
BillWoodruff13-Nov-11 11:00
professionalBillWoodruff13-Nov-11 11:00 
QuestionText Entry / Scrolling Dilema Pin
PDTUM12-Nov-11 6:41
PDTUM12-Nov-11 6:41 
AnswerRe: Text Entry / Scrolling Dilema Pin
BillWoodruff13-Nov-11 11:24
professionalBillWoodruff13-Nov-11 11:24 
GeneralRe: Text Entry / Scrolling Dilema Pin
PDTUM14-Nov-11 7:01
PDTUM14-Nov-11 7:01 
QuestionASP.NET Multi Language Pin
koncuk12-Nov-11 3:35
koncuk12-Nov-11 3:35 
AnswerRe: ASP.NET Multi Language Pin
Abhinav S12-Nov-11 21:35
Abhinav S12-Nov-11 21:35 
QuestionConnect and Read from USB Pin
Jassim Rahma12-Nov-11 3:11
Jassim Rahma12-Nov-11 3:11 
AnswerRe: Connect and Read from USB Pin
OriginalGriff12-Nov-11 4:57
mveOriginalGriff12-Nov-11 4:57 
QuestionCreate image from panel control to include child controls Pin
Danzy8312-Nov-11 2:02
Danzy8312-Nov-11 2:02 
AnswerRe: Create image from panel control to include child controls Pin
OriginalGriff12-Nov-11 2:28
mveOriginalGriff12-Nov-11 2:28 
GeneralRe: Create image from panel control to include child controls Pin
Danzy8312-Nov-11 2:40
Danzy8312-Nov-11 2:40 
GeneralRe: Create image from panel control to include child controls Pin
Matt U.12-Nov-11 2:55
Matt U.12-Nov-11 2:55 
GeneralRe: Create image from panel control to include child controls Pin
Danzy8312-Nov-11 3:36
Danzy8312-Nov-11 3:36 
AnswerRe: Create image from panel control to include child controls Pin
Luc Pattyn12-Nov-11 4:09
sitebuilderLuc Pattyn12-Nov-11 4:09 
GeneralRe: Create image from panel control to include child controls Pin
Danzy8312-Nov-11 4:29
Danzy8312-Nov-11 4:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.