|
The link you included says pretty much what I said! Linq2SQL is not getting any new features and is in "maintainence mode". That means *all* new dev effort is going into EF. I never said Microsoft was REMOVING Linq2SQL, I just said they abandoned it. Your very own Linq (no pun intended ) makes it pretty clear that Linq2SQL is pretty much "meh... if we find a serious bug in it thats a show stopper, we MAY fix it".
But whatever .
All I was telling the OP was that Microsoft isn't going to be doing anything with it going forward, so any new features are going to be strictly EF, so he shouldn't waste his time building his app around it.
|
|
|
|
|
There is quite difference between abandoned and maintenance. Abandoned means no further support which is not the case.
No comment
|
|
|
|
|
I think you are just arguing semantics at this point. If Microsoft tells you "we aren't going to be developing this any further", it is your choice to ignore them and continue down a dead end path.
|
|
|
|
|
Microsoft aren't adding extensions to + and -, either. That doesn't mean you shouldn't use them. Linq to SQL is part of the language and the Framework, and will remain so, and it's much nicer to use in certain circumstances than the equivalent code with DbAdapters and DataSets. It's absolutely fine to use it even if it's not getting extended in future (which is a big step away from 'completely abandoned').
EF is massive overkill for a lot of applications, particularly if you already have a database and can't use its magic wand to match everything up.
|
|
|
|
|
|
So I am attempting to achieve a zoom effect similar to Microsoft Office Word. When you change the zoom the entire document "zooms" in/out. The text area, the text itself, etc. I have actually done this before but it has been quite some time. So I cannot remember how to do it. And I cannot find anything on Google anywhere, perhaps I looked over it?
I think it had something to do with the Graphics class for the control and such. The setup is a Panel with a RichTextBox on it. Anyone else aware of how to do this? I just need a link or two that describe it.
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|
|
I am using scaling to perform what you are wanting.
First create your slider in Xaml.
<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.
ScaleTransform scaleTransform = new ScaleTransform();
Binding scaleXBinding = new Binding("Value");
scaleXBinding.Source = scaleSlider;
Binding scaleYBinding = new Binding("Value");
scaleYBinding.Source = scaleSlider;
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.
|
|
|
|
|
I think the OP means to implement this in winforms, not WPF.
|
|
|
|
|
In that case is should be easier, same concept just use the slider control instead of Xaml.
|
|
|
|
|
You can manipulate the 'ZoomFactor' property of the RichTextBox[^], but be sure you are using TrueType fonts:Quote: The zoom feature performs optimally when the document contains TrueType fonts. When a font that is not TrueType is used within the document of the control, the ZoomFactor property will use the nearest whole number value. Disclaimer: I've never used this property myself, and I bet if you had pictures or whatever inserted in your RTF the results would be a mess.
Note if you are using .NET FrameWork Client Profile this will work only in 3.5 SP1, or later. If you're using the regular FrameWork, this feature has been in WinForms since 1.0.
Hope it works for you.
"I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone." Bjarne Stroustrop circa 1990
|
|
|
|
|
OK...so since no one answered, my communication skills must be at fault...let me try again please...
I am trying to add radio buttons to a panel that are outside the normal panel size. I know that it will scroll during runtime and in the past I have used cut and paste to accomplish this, but the question is how do I add the control into the panel in the first place since the panel cannot be expanded during development? I hope someone can see through this to understand the problem. Thanks for the time...Pat
previously I wrote:
Good Morning...perhaps it's been too long between programs...but...
I am trying to create a page that has a panel inside a tab control. In the past, it seems I used the panel control to allow scrolling, but previously I never had any controls on the panel that needed to be added that were outside the panel area. I know that I can create text and paste it in and it will scroll automatically, but what if I need to add controls (in this case radio buttons) and those controls are outside the entry range on the development page? There does not seem to be any way to add to the panel once you have reached the bottom...or is there? I am using Visual Studio 10.
Thank you for your help....Pat
modified 13-Nov-11 15:22pm.
|
|
|
|
|
WinForms .NET 4.0, VS 2010 Pro SP1
1. Create a WinForm project
2. Make the initial default Form1 800x600
3. put a TabControl on it: size it to taste
4. select any TabPage you've added (or one of the default two that are automatically created when you add the TabControl to the Form):
a. set the AutoScroll property of the selected TabPage selected to 'true
b. insert a Panel in the selected TabPage: set its Location to 0,0, and size to 1000x800:
Discussion: even with the Panel 'AutoScroll property set to 'false (in case you thought that that was a factor here): you can still scroll the TabPage at design-time and put Controls anywhere on the Panel.
But, you may notice a weird graphic hiccup that I consider a bug in WinForms: the bounding area of the Panel may appear to extend to the left of the TabControl in a way that has obviously nothing to do with the settings of the Panel: but, this has no effect on your ability to use the larger-than-TabControl Panel at design-time.
Also, if you copy and paste a Control which has been sited (for example at the right edge of your big Panel), you may be surprised the pasted Control appears outside the current viewport: but it's there and you may have to scroll around to find it and move it. Also, I think, a bug in WinForms. Although, to give the benefit of the doubt: is there any code of etiquette about what's supposed to happen when you copy and paste Controls in a container in terms of "placement" ?
I remember when I tried to do this once that I thought setting the Anchor property of the Control that was in the big Panel to 'Right would make the inserted Control "snap" to the right side of the big Panel, even if it was out-of-view at run-time: wrong.
In your case since you are using RadioButtons, and presumably are using them all in one container so that only one of them is "on" at any one time: why not just create some Panel or GroupBox or whatever, then site that where you need it to be in the big Panel, and then put all the RadioButtons in that ?
"I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone." Bjarne Stroustrop circa 1990
|
|
|
|
|
Thank you Bill,
Sometimes I AMAZE myself...how could I have missed something as basic as a property setting. I guess I can't see the forest through the trees. BTW...that works perfectly and solves my problem. I appreciate your time and input and am marking this reply as a correct answer. Best Regards, Pat
|
|
|
|
|
|
|
Hi,
I have a Panasonic TDA100D PBX for our phone exchnage. It has Serial and USA connection. I have already tried the Serial and I am ble to get the calls records as it will automatically throw it to the hyper terminal once I connect. Now I want to know how can I do the same when I am connected to the PBX using USB?
Thanks,
Jassim
|
|
|
|
|
Generally in these situations the USB acts as another serial port - just tell Hyperterminal (or your code) to use that COM port.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Hi all. I have a Panel control that I have created like a sheet of paper that contains different child controls. There are pictureboxes, labels, and TableLayoutPanel controls. I want to print all objects on the Panel control. What I was trying to do was creating a Graphics object from the Panel control which is the Sheet:
Graphics sheetGraphics = Sheet.CreateGraphics();
The object 'Sheet' used to create the Graphics is actually the Panel control that contains child controls. I tried to create an image from the Graphics object:
Bitmap sheetBitmap = new Bitmap(Sheet.Width, Sheet.Height, sheetGraphics);
Having thought I had an image I tried to print by using a printer graphics object but none of the child controls appeared in the image, only the panel. But I'm guessing it did not work because I used a Graphics object from the Panel control to create the image. Is there a way I can create the image to include the data in the child controls as well as the Panel control, or maybe a better way of achieving the creation of the image? I would really appreciate to know if there is. Thanks in advance.
|
|
|
|
|
Try:
Bitmap bm = new Bitmap(panel1.Width, panel1.Height);
panel1.DrawToBitmap(bm, new Rectangle(0,0, bm.Width, bm.Height));
bm.Save(@"D:\Temp\pan.jpg", ImageFormat.Jpeg);
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
Works Griff, thanks. But another problem. The printout of the document looks like a compressed image that has been printed, some kind of blurr image. The preview also shows the same. Anyway of maintaining the look of the document without being compressed?
|
|
|
|
|
I am not sure but this[^] may help.
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|
|
Still not looking good like the one on the Panel control. Can't understand why this is happening.
|
|
|
|
|
Dan_K wrote: Can't understand why this is happening.
That is simple; you are basically capturing a screen image at the screen's resolution (by default, a Bitmap object has the resolution of the screen, typically some 96 or 120 dpi), whereas most printers do print at 300 dpi, so they would upscale your bitmap by a linear factor of around 3 to get the size right, resulting in a pixelated outcome.
I haven't done this myself (explicitly printing controls inside controls that is), however I would try using a larger bitmap, setting its resolution to the printer resolution, then painting the panel into it.
|
|
|
|
|
Yeah I believe so. I thought of it earlier and as a try, I changed the resolution of the image to 300. After printing, I realised the print output had become very small so I stopped using that approach. But if the cause has got something to do with the resolution, then It means that I have to make some calculations that will give the size of the print output the same as the size of the Panel control when I change the resolution. I will try that and see. Thanks.
|
|
|
|
|
Yep, you need to upscale the bitmap size by printerDPI/screenDPI . Both are available in their respective Graphics objects; the screen DPI is also available in other classes (SystemInformation, Screen, not sure). And they come as pairs (dpiX,dpiY), I have never seen those numbers not being equal though.
|
|
|
|