MajorDad's Q&A profile
Windows Forms Why won't label background actually set to transparent?
I have a label and for some reason it just won't set to transparent and it is driving me nuts... http://i69.photobucket.com/albums/i53/adwins04/summary.jpg http://i69.photobucket.com/albums/i53/adwins04/properties.jpg In the picture it is the label that says Summary. It seems that when backcolor=transparent, lable control will use the same way which your form's onpaint method do, to redraw its background. add a lable "lable1" and set its backcolor to transparent. Try following code, you will notice that the lable redraw its background with a red rectangle on the topleft, the same as the form's onpaint do. protected override void OnPaint(PaintEventArgs e) { SolidBrush redbrush = new SolidBrush(C ...Show All
Windows Forms Commit changes to database
Hi, My Windforms DataGrid 1.1 is bound with two database columns. The user edits the contents and thereby changes the contents of the dataset the grid is bound to. I need to commit these changes to the database on a button click. Trivial question but i dont seem to be getting it right :( hi, i did that but since my sql table didnt have a primary key SQLDataAdapters auto generated update statement complained. I had to explicity add the Update Command to the DataAdapter, add parameters and then it worked like a charm. Rohan Wali ...Show All
Windows Forms Switching between Console application and Windows Forms applications
I was hoping to write a single application that can behave as Console application if specific run parameters are specified and behave as Windows Forms application otherwise (of course without the Console). For example: public static void main(string[] args) { if(//check if args has specific run params) { //do stuff Console.WriteLine(//results); return; } else { //Show nice form and all that } } Couldn't find any pointers as to how to achieve this. Any pointers Mad.Earth sure, I understand and agree. One way maybe to use some Win32 API to hide that window (ShowWindow ) when you get a handle via the FindWindow API. Can't think of a way of doing this other than t ...Show All
Windows Forms Using information displayed in a comboBox.
I have two combo boxes that are both using one XML file to populate them. In this XML are names and the db connection strings associated with those names. I can view the info in the combos but what I am trying to get to from this is to use the conn string displayed in the second combo to be called when the selected index and data adapter (need the connection here also) for the third combo is activated. this is in VS 2005 C# did that make sense that code was written using .net 2003 . Private DidPreviouslyConnect As Boolean = False Dim mySqlConnection As SqlConnection Private Sub FillClients() Dim isConnecting As Boolean = True While isConnecting Try Dim str As String = &q ...Show All
Visual Studio IF THEN ELSE
Hi, I thought I would do a simple msbuild script to do what I thought would be a simple thing to do: ReadTheRegistryTask() if (key == 'aaa') then run task A else run task B How do you do that in msbuild the Choose-When contstruct is just what I need but it can only be a child of a project. I have a Task to read the registry but it doesn't like a Task just under a Project and act as the input. I can do all I need to do in isolated pieces but it doesn't seem to go together :-( The only solution i could come up with is to make your own custom task. Then that task will ouput the name of the target you want to call and all you'll have to do is call the CallTarget task. Here's ...Show All
Game Technologies: DirectX, XNA, XACT, etc. CreateDevice hangs in multithreaded environment
Hi, I'm working on a multithreaded renderer on DX9. I've ensured that the window used by the device is created on the same thread that is calling CreateDevice to avoid the deadlocks mentioned in the SDK documentation. I have one very weird behaviour: the very first time (read the first one after a computer reboot) i launch my application on a multicore machine (running 2000/XP/Vista), the CreateDevice will hang if want a fullscreen presentation. If i want a windowed presentation, it's all fine. Everytime i'll restart the app it will work fine. Any idea why i could get this weird behaviour Thanks in advance, /David ...Show All
SQL Server avoiding accidental deletes...best practises??
Is there a way to get sql server to present a message box asking if you are you sure you want to delete all the data in a table. also are there any 'best practises' to avoid accidental deletes. For example Im making a lot of delete statements like: del from table_name where item_id = 23 but one time I executed this statement I mistakenly excuted the first line of the statment only, resulting in the loss of all the data in the table, luckily I was able to re-populate the table, but I wish to avoid that mistake in the future. Let me ask this question: would you want a script stopping half-way through a stored procedure To wait for a user dialog box to complete at 4am If you are having p ...Show All
Windows Forms Changing size property
How do I enable the changing of size of a control like combobox Thanks. regards Alu I have a similar question as well. Not long ago, I tried a bunch of ways to move a button. I did probably everything you could possibly do to attempt this (put it in a panel, did some invoke stuff, made a new method, etc. etc.) and it always gave me the error that the property is readonly. How do I move and resize controls (those properties are according to VS, readonly) ...Show All
SQL Server ssis packages
Where are SSIS packages stored and how can I see them in SQL Server Management studio partha mandayam wrote: I get an Access denied error when I try that. Talk to the DBA to grant you permissions and to ensure that Integration Services is up and running. ...Show All
.NET Development Password Authenication ? What's wrong with this Code ? PLEASE HELP
Can you please help me with this , it only accept the first password in the table when i put a username and password <<<< these are two Textboxes here the code OleDbConnection Myconnection = new OleDbConnection(StrConnection); Myconnection.Open(); string Strcommand = "SELECT * FROM Table"; OleDbCommand Mycommand = new OleDbCommand(Strcommand, Myconnection); Mycommand.Parameters.Add("@username", OleDbType.Char, 32); Mycommand.Parameters["@username"].Value = username.Text; OleDbDataReader Myreader = Mycommand.ExecuteReader(); if (Myreader.Read()) { if (Myreader["Password"].ToString ...Show All
SQL Server Trying to delete a bad SSAS DB
Hello, I had a SSAS DB on a SQL Server EE, and then the need for a development machine arouse. The current EE version was backed up and then likely restored to a Standard version. The DB does not work, however, I cannot remove the SSAS database. The error I get basically states that "The installed server editions allows not more than 3 partitions and not more than 1 writeback partition". I understand that, and now just want the DB to go away. Please help. Try opening an XMLA Query window in SQL Management Studio and running the XMLA command to delete the database. This should by-pass the validation causing you problems. Below is an example of such an XMLA database delete script. (The Database ...Show All
Visual Studio Express Editions Searching an Access Database from a Windows Form
Hi, I am trying to include an Access database search in a windows form but don't really know where to start. Can anyone help Start by taking a look at the data samples for VB and the ADO.NET help http://msdn2.microsoft.com/en-us/vbasic/ms789075.aspx#data http://msdn.microsoft.com/data/learning/adonet/ PS. Most of the VB data samples revolve around using SQL Server 2005 as the data store...however the same principles apply when using any database ...Show All
Visual Studio Express Editions CD/DVD case image?
I have a curious question, i've written the express versions to a dvd incase I need to reinstall them in the future. Is it possible to get some sort of Visual Studio 2005 Express dvd case cover image that I can use to print in Nero's CoverDesigner This way I can just put it in with the rest of my program cd/dvd cases and be able to easilly pick it out. (plus it'll look nicer than something scribbled on a piece of paper) Whatever happened to this I sent an email to Luke Hoban ages ago about this but never got a reply. ...Show All
Visual Basic VB 2005 Express false compiler error
I have a VB 2005 WinForms Project which is giving what I think is a false error. On the Designer screen for the main form (which normally displays the form layout etc.) I get: One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes. '.ctor' is not a valid identifier. Hide at Microsoft.VisualStudio.Shell.Design.Serialization.CodeDom.CodeDomEventBindingService.ValidateMethodName(String methodName) at System.ComponentModel.Design.EventBindingService.EventPropertyDescriptor.SetValue(Object component, Object value) at System.ComponentModel.Design.Serialization.CodeDomSeriali ...Show All
Visual Studio 2008 (Pre-release) Not able to reference to custom control in another dll (RC1)
After installing RC1 I am not able to initialize custom controls created in another project even by using mlns:customControls="clr-namespace:XYF.Controls.WPF;assembly=XYF.Controls.WPF", although on I can add the same control via code behind but in Xmal it pukes. Also in the xaml if I am creating a name of panel using name="XYX" I am not able to reference them in code behind. Any ideas why it is happening. Thanks Atul Wait, can you compile the project, or is it just the editor that's saying that things can't be found The editor hasn't been able to properly resolve types out of the generic xaml namespaces as far as I can remember, so it underlines them and says tha ...Show All
