c0d3bl00d3d's Q&A profile
Visual Studio 2008 (Pre-release) How to bind Background to RadialGradientBrush.Color?
Hello, I defined style for button. Its template contains rectangle filled with RadialGradientBrush and I want to bind Color property of brush to Background property of button. I know, Brush and Color are different types, but how to bind it correctly < Window x:Class = " WPFForm.Window2 " xmlns = " http://schemas.microsoft.com/winfx/2006/xaml/presentation " xmlns:x = " http://schemas.microsoft.com/winfx/2006/xaml " Title = " WPFForm " Height = " 441 " Width = " 520 " > < Window.Resources > < Style x:Key = " ButtonStyler " TargetType = " {x:Type Button} " > < Setter Property = &quo ...Show All
Windows Forms How do I programmatically add checkboxes to a form at runtime
The problem i'm having is programmatically adding checkboxes to the form. So far I have this code which works: Checkbox cbk = new Checkbox(); cbk.Location = new Point( 10, 10 ); cbk.Text = "I was created at runtime"; this.Controls.Add( cbk ); But I need to have the checkbox name generated by the database, I am unable to figure out how to assign a value from a SQLDataReader to be the name of the checkbox, my attempt below will not work (just replacing the hard coded name with the value from the db): while (reader.Read()) { CheckBox reader[1].ToString() = new CheckBox (); reader[1].ToString().Location = new Point (10, 10); reader[1].ToString().Text = "I was created at runtime" ; this .C ...Show All
Visual Studio 2008 (Pre-release) How to configure a service which implements two contracts
Appreciated if anyone could tell me how to configure a service which implements two or more contracts(interfaces) within WCF configuration editor. The service is expected to be hosted in IIS as well. You need two endpoints for two different contracts. After adding the first endpoint (with the "Create a New Service" option), you can click on the "Services" folder and select "Create a New Service Endpoint" for the first service, or you can expand the tree of the service up to the endpoints folder, then right-click it to add a new endpoint. ...Show All
Visual Basic Default Modifiers to Private
Does anyone know how to default the Modifiers 'property' to Private when you add a new control to a form or control surface in the designer I really dislike the fact that it is set to Friend by default... I think the stricter it is, the better (to an extent). Chris I don't think that it is possible. If it is, you would need to implement your own serializer or custom actions. Take a look at System.ComponentModel.Design or System.ComponentModel.Serialization and see if there's anything there. Hope this helps, ...Show All
Windows Forms Help Creating Bold Text...
Ok, the problem I'm having is thet when I select my text and click my BoldButton, no matter what my selected text font or text size is set to, it reverts it back to 'Microsoft Sans Serif, 8.25 pt' Here is my code: If (Color.op_Inequality( Me .BackColor, SystemColors.ControlDark)) Then Me .BackColor = SystemColors.ControlDark End If If Not ( Me .Font.Bold) Then Me .Font = New Font( Me .Font, FontStyle.Bold) RichTextBox1.SelectionFont = Me .Font Else Me .Font = New Font( Me .Font, FontStyle.Regular) RichTextBox1.SelectionFont = Me .Font End If RichTextBox1.Focus() I know it has to be a simple fix...........Thanks for your reply. yeah, her ...Show All
Visual Studio 2008 (Pre-release) how to implement: text caret
Hi, What is the proper way to implement a caret for a text editor in WPF Right now I'm using a Rectangle+Animation as a caret. It works okay, but I really would like to have WPF support. to make sure my application has the correct behavior (caret width, blink rate, bidi caret, etc) . Note: win32 has caret support: CreateCaret, SetCaretPos, ShowCare, HideCaret, ... Thanks Felipe Currently WPF doesnt expose the caret... so customizing would not be possible... It is one of the customer feature requests for future releases... ...Show All
SQL Server Nesting stored procedure, how to ?
Hello, I'm trying to use nested stored procedure but can't get it to work. I've created a stored procedure named 'sousmenu1_parents' which does a simple select, no parameter. here's what I'm trying to achieve now : CREATE PROCEDURE SelectAllDroitSpe -- Add the parameters for the stored procedure here @UserId int AS EXEC sousmenu1_parents ; BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON ; -- Insert statements for procedure here SELECT sousmenu1_parents . menu_id1 AS sousmenu1_id FROM authorisations_speciales LEFT JOIN sousmenu1_parents ON authorisations_speciales . page_id = sousmenu1_parent ...Show All
SQL Server DTS Permissions
Hello all Hope someone can help, I have set up a new user and restricted his acces to the db, how can I allow him to read DTS packages but not change or execute them Thanks Richard ...Show All
SQL Server SQL2005 Tools don't work unless all components installed on C:
On serveral computers in our lab and in production, we installed SQL2005, putting the Data folder on d: because we expect to have a very large database file, but all else on c: When we try the Surface area config tool, and choose the Surface Area configuration for Services and Connections, it responds with an error regarding something being "out of range", then closes when we click OK. Previously, in a couple of lab situations, we installed everything on C:, and all tools worked fine. Is there a known workaround which will allow us to leave the data folders on d: to accommodate large amounts of data, and still have the use of the tools Jim When I try to run the Surface Area Configuration tool, the popup error say ...Show All
Smart Device Development Debugging WinCE 5 apps not working
I'm trying to debug a Compact Framework 2.0 app on a Windows CE 5 device from VS2005 sp1. I assumed this should just work out of the box. When I set a breakpoint in the CF app, deploy and start debug the breakpoint indicates it wont be hit. The little exclamation point icon on the breakpoint indicates 'the specified module has not been loaded'. Any idea what is causing this The app deploys and runs fine on the device but I cannot debug. I thought this was a no-brainer. After some more digging I seem to have uncovered the solution: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=929555&SiteID=1 The device I am using has NetCF 2.0 sp1 installed in ROM and I did not have it installed on my d ...Show All
SQL Server Looking for a good example of a script task in the dataflow that writes to a file
I need to write back to a legacy system in the form of flat file --the first row would be a header and the remaining rows would be the actuals rows of data--each field would have a column delimiter of , and a row delimter of CRLF. The source is a SQL Server 2005 table. Im looking for a good example of a script task in the dataflow section that writes to a file. Can anyone show me the code how to do this or point me to a link. thanks in advance Dave Jamie, No there is not an example in Donalds book that explains how to produce an output file. He covers how to write a Dataflow script task to produce an XML output File--but that is a very different object model. Sadly Donalds boo ...Show All
Visual Basic How to format a HTML MailMessage ????
Hi, I have an application which sends an email after certain process, How can I format the html part like using css styles for fonts families, sizes, colors, etc , I have tried to concatenate the hole tags without any success because but they need "". Any idea Thanks in advance George Thanks for your replay, this is my code, is a simple code but it works Private Function SendMailTo( ByVal xSmtpServer As String , _ ByVal xFrom A ...Show All
.NET Development dataview + filter
Hi I have a grid containing up to 100k rows. i want to perform filtering on the grid. i also have advanced filter options like match case , match whole word and regular expression. i have tried in 2 ways. 1. parsing the whole grid and checking the rows. i can use all filter options but it is very ineficient and works very slow. 2. i have tried filter on the datasource. i have done it with the method dataview.filter . this works very fine , but the filter is to simple. i cannot use the options above (only match case) . is there any other way in order to perform this filter i am stuck on this for a long time. thank you I don't have any database. data is loaded from files. also , the datatable.select method ...Show All
SQL Server Who's the idiot that designed the file destination?
It's funny: Everyone thinks that CSVs are awesome to transport data. I mean after all, SSIS defaults to Comma Delimited files. Even Excel defaults to it. Microsoft is supposed to be our leader! They should get this right. And get the terminology correct too. How many people describe the file as comma separated It's delimited! Even SQL server calls it delimited by the "delimited" drop down. CSVs suck and i will tell you why: When you transport any text field (especially Address) it has the possibility of containing a comma. This causes data to be parsed into the wrong fields. Why in God's grace would you EVER get in the habit of choosing a delimiter that SOMETIMES doesn't work I'll tell you a little short story: I hav ...Show All
Visual C# Debugging a multithreaded app
Hello all I have an app which is divided into two main components which are decoupled from one another by the use of an event mechanism. The only way the two components communicate with one another is by firing and responding to events (one component is consistently the caller, the other is consistently the callee). You can find more background on this particular app's issues in this post but some of that information is now outdated. Basically I have a static object in the caller component which fires an event to the callee component which results in the callee loading a component in a COM DLL via an RCW assembly. Originally, the COM DLL was not being properly released at the end of execution but after moving the 'unloading' code up into t ...Show All
