In XAML: 1 2 3 4 5 6 7 8 9 <Button Name="myComboBox" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}" /> <ComboBox Name="myButton" Style="{StaticResource {x:Static ToolBar.ComboBoxStyleKey}}" /> <Button Name=”myComboBox” Style=”{StaticResource {x:Static ToolBar.ButtonStyleKey}}” /> <ComboBox Name=”myButton” Style=”{StaticResource {x:Static ToolBar.ComboBoxStyleKey}}” /> In code (C#): 1 2 3 4 5 myButton.Style = (Style)FindResource(ToolBar.ButtonStyleKey); myComboBox.Style […]
Continue reading…
Posts by admin
How to count the frequency of the words in a text
Here is the sample code wirtten in c#: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 using System; using System.IO; using […]
Continue reading…
How to find all subclasses of a given class
The following function will return a list of all subclasses inherited from a given class. Please note, that it works only within a single assembly, same as which holds the given superclass. 1 2 3 4 5 6 7 8 Function FindSubClasses(Of TBaseType)() As IEnumerable(Of Type) Dim baseType = GetType(TBaseType) Dim […]
Continue reading…
How to use SSRS Web Service from Java
Import the reporting service wsdl using wsimport tool which is available in JDK starting from v1.6: wsimport.exe http://<server>/reportserver/reportService2005.asmx?wsdl -s -extension</server> Copy the resulting package to your java project. Amon other things, it will contain the ReportingService2005 class and the ReportingService2005Soap interface which are the main point of your interest.
Continue reading…
How to serialize objects in VBA
Generally speaking, VBA doesn’t provide the possibility to serialize objects, and if you are interested in this topic, you might seen quite a few blogs around this thing, and the answer is always the same – generically not possible, period. But nothing is impossible though. This article describes a workaround which will give you a […]
Continue reading…
How to exclusively lock a table in MS SQL
Start a transaction and select from the table using the (TABLOCKX) hint. As the result, read from this table outside of the transaction will be queued until the transaction is committed or rolled back. 1 2 3 4 5 6 7 8 BEGIN TRAN SELECT * FROM Table1 (TABLOCKX) […]
Continue reading…
How to change a Workspace of a Team Project in Visual Studio 2012
Go to File ¬ Source Control ¬ Advanced ¬ Workspaces… Select a workspace and click “Edit…” Select appropriate local folder for a desired working folder and click “Ok”.
Continue reading…