Answer Questions
Stéphane Beauchemin Inheriting default styles.
I have a templated control: class MyControl: Control { ... } I have a control that inherits from it: class MySpecializedControl: MyControl { ... } I have a style for the base control in an application-scope resource dictionary: < Style TargetType = " {x:Type local:MyControl} " > ... </ Style > The style is applied successfully to MyControl, but isn't applied to MySpecializedControl. I know I can provide an explicit style with a "BasedOn" attribute for MySpecialized control. I can understand why that might be the case (although the behaviour is a bit disappointing). But builtin controls don't suffer from this limitation. A class that derives from Button gets the syle for Button. How wou ...Show All
OmegaMan Office Word 2003 component in .Net 2005
Hello. I've posted this mesage at "Visual C# Generals" forum, but I'll post again in this topic. Hello. I need to develop a plugin for Word in Visual C# and as a test, I have to do the following application : in a Word document, I have to insert a button and when I press it, a windows form must appear with a textbox. That textbox contains all I type in document. Can you help me with some examples and tutorials about how to develop Word plugins in Visual Studio .Net 2005 using Visual Studio Tools for Microsoft Office 2003 System Thanks' very much. Thanks' Cindy for reply. It was exactly what I wanted. If there are useful links like that from post above, please type here. Thanks again. ...Show All
KevinBurton Accessing invidual objects for a xaml file parsed with XamlLoader.Load()
I am trying to access objects created by parsing a .xaml file, using XamlLoader.Load(). For example if my .xaml file contains rectangles I'd like to be able to access them and modify a parameter, like their color. Is there a way to obtain a tree-structure of the objects created during the parsing you can create a resourcedictionary and accees Items using key Uri u = new Uri ( @"/;component\Dictionary1.xaml" , UriKind .Relative); ResourceDictionary res = Application .LoadComponent(u) as ResourceDictionary ; Rectangle rect = res[ "rect1" ] as Rectangle ; Stream s = File.OpenRead("test.xaml"); Canvas newCanvas = (Canvas)XamlReader.Load(s); s.Cl ...Show All
HerbD Building multiple solution
Hello, I am new to msbuild and I have to automate a project. Here is the structure c:\mydir component1 Solution1 Solution1.sln ProjectA ProjectA.proj ProjectB ProjectB.proj component2 Solution2 Project C Solution3 ProjectD .... I would like to have a .proj file for each component and then a master .proj file that just call this sub .proj files. However, i need to know if a solution fail and need to do some action like send mail ,. Is this possible with msbuild . Also, I would need to copy the output for the indiviidual project to a common location . some sample code or some hints would be very helpful Thanks in advance ...Show All
laue Having conflict re-installing Word 02 with XP
Help! I run Windows XP with Word 2002 and all was find until last week when I accidently deleted Word 2002. Now I can't get it back. I installed the CD with it on there that came with the computer. Then I clicked on the start bar and "Microsoft Word" and it said it was installing. But then I get an error that says "This patch package could not be opened. Verify that it exists and you can access it, or contact application vendor to verify that this is a valid windows installation package." I have tried it several times with the same result. I do have a valid windows program and even went and downloaded updates to see if this would help but nothing is working. Any help appreciated. Thanks in advance, jh ...Show All
Tryin2Bgood Render only inside a specified area.
If you render a rectangle in the windows bounds the entire rectangle becomes visible. How can i do to only render half of the rectangle, let's say that i want everything to the right of 100pixels to be blank and i render a rectangle that is 70pixels wide, 50 pixels from the left. Then i only want the first 50 pixels of the rectangle to be visible. I've tried to add the rectangle in a usercontrol but that doesn't work, i render everything inside a canvas so i can use exact positioning. For cusom controls this code is even better :) this.ClipToBounds = true Are you looking for clipping Just set the Clip property . HTH, Drew ...Show All
Cyber Sinh How to draw a border around a canvas in XAML app
I have a user control that inherits from the canvas class. How can I draw a border around this canvas using c# Also, can I give it round corners In order to do that just put a rectangle inside you canvas. That'll give both ability to manage borders by using Stroke and StrokeThichness and rounded borders - see XRadius/YRadius. ...Show All
Spanglishone ctc compilation error
Hi, I want to add a new command to my existing package. I made the following changes in my code. Changes in Pkgicmd.h #define cmdidexistingCmd 0x0550 #define cmdidNewCommand 0x0551// new command Changes in pkg.ctc BUTTONS_BEGIN GUID_Commands:cmdidexistingCmd SEE_CMDPLACEMENT guidOfficeIcon:msotcidNoIcon, BUTTON, , "ExistingCommand"; GUID_Commands:cmdidNewCommand SEE_CMDPLACEMENT guidOfficeIcon:msotcidNoIcon, BUTTON, , "NewCommand"; BUTTONS_END CMDPLACEMENT_BEGIN GUID_Commands:cmdidexistingCmd, GUID_Menus:IDG_CTX_DATASTORENODE, 0x0009; GUID_Commands:cmdidNewCommand, GUID_Menus:IDG_CTX_DATASTORENODE, 0x000A; ...Show All
Beckwith Taskpanes created in VSTO workbook visible to all other workbooks which are opened --- How????
Hi Alex Thanks for your help. I think in my case for the moment I need to use a floating form. When Office 2007 is available I'll let loose on the task pane. Can't wait. I'll keep your code - usefull for other things. Many thnaks. Cheers David Hi Alex Thanks for the e-mail. Its a clever work around. Am I right in saying that you take the current VSTO document, save it, and then you would either save it as a new one in the case of someone who wants to create a new workbook or if it is an existing workbook, the contents of the existing workbook would be copied into existing VSTO project I'll have to think about this one. Two issues I would have are as follows: If I make anhancements to the ...Show All
lysy95 Slow Render Performance (2000+ UIElements)
I’m creating a Grid that is 35x35, each cell containing a ContentControl with a ContentTemplate defining a TextBlock inside a Border. It is necessary for the entire grid to be rendered at one time. Perhaps obviously, there is a noticeable delay after my code ends (building the grid dynamically) and when the grid displays on the screen. (based on Timers and a Debug.Write) The delay also seems to occur when I’m building the grid for printing and its not actually rendered. I would guess I’ve reached a limitation of WPF, but is there something I can do to minimize this delay Thanks for suggestions. ----- Code --- <Style x:Key="DefaultCellBox" TargetType="{x:Type ContentControl}"> <Se ...Show All
ZindrosH Inheriting from inherited user control
I'm having a problem with a user control generated code, when it inherits from other than UserControl. Steps: 1. Add new User control 2. Replace in the inheritance declaration UserControl for MyBaseUserControl 3. Compile The generated class part is still inheriting from UserControl. You can change the ".g.cs" file, and sometimes you can get it succesfully compiled, but the error cames back again and again :) There is another way to do that Thanks in advance... Quick question: Have you changed Root XAML node of the MyBaseUserControl.xaml file to MyBaseUserControl as well Let me know!!! Agreed. The ctor of my BaseWindow currently sets its own Template property to a ControlTemplate (store ...Show All
PeterVrenken VS2005 and Source Safe Binding
I am converting many cpp projects from VC6 to VC8 and am having problems with Source Safe binding in VS2005. I have a working structure like this: d:\common\ com\ project1\ project2\ project3\ include\ project4\ include\ In VC6, I could have project1 open, and add a header file that is found in common\include and still have source control over that file while working in VC6. Now that I have moved to VC8, I try to add a header file from common\include\ to project1, and it gives me an error message stating: Some of the files you are adding to your project are located outside of the project's binding root. These files cannot be source controlled unless they are moved. If the ...Show All
MacedonHacker jung for .net
Hi, Has anyone tried converting jung (java unversal network/graph framework) the source is available in jung.sourceforge.net. I've tried importing all the source code, but have problem with the apache component. This probably lead to further question, have you tried converting apache to J#. Sincerely Anthony Hi, Please post the exact problem description. We are not supposed to look at any of the code not owned by us. I would appreciate if you send your own repro code instead of pasting some open source code. In the second case i am sorry to say that we will not be able to help you out. Thanks. Oh well, nevermind. Your answer sounded like, I might have offended you. i w ...Show All
redshock How to access Parent Element of the ItemsControl's Panel?
Here is the situation: I have created an overloaded Canvas object as an external assembly. Now I use it as a panel object in ItemsControl: <Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:Custom="clr-namespace:CustomNamespace" Stretch="Fill"> <ItemsControl> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <Custom:CustomCanvas/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> </ItemsControl> ....... </Viewbox> How can I access that ItemsControl object from my assembly. Thing is that I define some resources on ItemsControl and I want to use them in my Canvas Assebmly C# code. On runtime the CustomCanvas has P ...Show All
svxtc How to combine data from two tables into one EntityType?
Using the vNext August CTP and Linq May CTP LINQtoEntities Sample I would like to include the CategoryName of the Northwind Categories table in the Product EntityType, to be able to do following query: var products = from p in db.Products orderby p.CategoryName select p; foreach ( Product p in products) Console .WriteLine( "{0}\t{1}" , p.CategoryName, p.ProductName); What does the entity model have to look like Thanks! Has this been, or is it in the plans to be, addressed via any other method than an sp or a view I am attempting to address a similar situation in that if I have an employee (which is stored in an employee table) and from an OO perspective the ...Show All
