Answer Questions
Omar# Click once - customisation
hi all, I have created a windows forms app that uses the settings file to store the SQL Server name. I thought that this would enable me to customise the applcation for a number of sites without re-compiling for each one! the Settings File contains amongst others the name of the Local SQL Server. (always unique ) to facilitate easy updates, I have used the click-once methodology and hosted the deploy files locally at each Site on a server. The AutoUpdate works perfectly but the .config file( settings) is replaced each time with the standard settings file, the settings in this file are unique for each site! How do I deploy this application, while being able to have unique settings files for each site changing settings & ...Show All
AshleyT Show modal status dialog ?
Hi, I was wondering if it is possible to show a modal status dialog The problem I have is that once the form is show the showing thread stops the moment it shows the form thus I cannot start the working thread. So in short how can I get this to work (simplified pesudo-C# code); Thread myThread = new Thread(); Form myForm = new Form(); myThread.myEvent += delegate { myForm.action(); }; myForm.ShowDialog(this); // << Execution stops at this point until form is closed. myThread.Start(); I tried showing the form on another thread (so one thread shows the form, the other starts the worker thread), but this resulted in the inability to make the form modal. Any suggestions are greatly appreciated, Ben. ...Show All
jhusain executing SQL query in C#
hi, suppose we have some text boxes already binded with BindingNavigator how to execute an SQL query using the code so the binded data can be specified with this SQL statement using C#. thanx i think this piece of code would help but Lets suppose that we have this query "SELECT * FROM emp WHERE sal > 6000" and i want to execute this query using the code. regards here is the code textBox1.DataBindings.Add("Text", BS, "id"); textBox2.DataBindings.Add("Text", BS, "name"); thanx for your reply but this is not what i want when you bind a textbox with the binding navigator contr ...Show All
milkshake datagridview: show a value instead of the one in the db
hello wolrd, how can i show a value in the datagrid instead of a value in the db eg. show "stopped" instead of "0" i don't know exactly what you mean but a int is a integer as i told you i can't modify db, my task is to make a select case with the integer values of the column and display the description, probably i have to make a replace in the dataset or something like this, but i don't know how of course int mean integer!!! i have this in the database: "1" and have to display this: "started" I need to do the association with c#, in the db there is only int rapre ...Show All
Kjelle If datagridview.Col = 0 Then
With datagridview.Rows If datagridview.Col = 0 Then ...... how do I test to see if the current datagridview's column is zero thx. -greg and how can I set the column thx. thx. -g try this: handle the cell enter event of the dgv. As soon as you enter cell(0) of any row, the row is selected. and it also works when you control+select rows by selecting the first cell of rows. Private Sub DataGridView1_CellEnter( ByVal sender As Object , ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellEnter If (e.ColumnIndex) = 0 Then Me .DataGridView1.Rows(e.RowIndex).Selected = Tr ...Show All
Mr Switch CheckedListBox question
Is there a way to change the color of highlight selection it's blue by default.... Set the SelectionMode property to None and add this MouseDown event handler: private void myCheckedListBox1_MouseDown(object sender, MouseEventArgs e) { int ix = CheckedListBox1.IndexFromPoint(e.Location); if (ix >= 0) CheckedListBox1.SetItemChecked(ix, !CheckedListBox1.GetItemChecked(ix)); } ok this is what I did..... private void button3_Click( object sender, EventArgs e) { for ( int i = groupBox1.Controls.Count-1; i >= 0; i--) { CheckBox chx = ( CheckBox )groupBox1.Controls ; if (chx.Checked) { MessageBox .Show(chx.Name); } } } ...Show All
Ghassan Tadros dataGridView
Hi here i'm trying to implement database operations like add, delete, modify in a database (sql server2005) using c# ado.net how can i do this can anybody give me a simple code. Thanx-Nagu A sample would be too large to post. However there are numerous samples available online. Here are some links. http://msdn2.microsoft.com/en-us/library/fbk67b6z.aspx http://www.15seconds.com/issue/040615.htm http://www.windowsforms.net/Default.aspx tabindex=4&tabid=49 Michael Taylor - 7/28/06 ...Show All
Sheng Jiang &#40;&#33931;&#26207;&#41; Problems using custom controls in the designer [VC++]
I'm writing a windows forms application using Visual C++ express 2005. I created some custom control inheriting from usercontrol, and compiling them in a dll. This way I can add my controls in the toolbox, but if a form already contains one of these controls and I regenerate the project, the designer tells me that the instance of that control was not created. Usually if, after that, I run the project the designer gives no more errors. What is the problem Next, I often have to add method calls to my user controls in the InitializaComponent method, making the designer unable to show the form. How can I avoid this behavior Where is a good place to search info about interaction with the designer I have VC++ ...Show All
Camulus How to enable/disable toolstrip buttons?
Hi All, I have a MDI form that contains toolstrip with buttons. Now my question is how do I enable/disable any button on this form from any child form of this MDI form Thanks, Aniruddha One way to do this would be: 1. add an event to the child form(s) that the child form raises at the appropriate time. 2. add an eventhandler to the parent form that handles the child form's event and enables/disables the appropriate toolstrip button. 3. remember to remove the eventhandler when the child form is closed. Tony ...Show All
ShrikantBijapurkar Can I DragDrop to Notepad?
Hi, I am trying to drag a text or picture from my application to notepad or mspaint, Can anyone tell me how I can do that thanks in advance, idos I am using 2005, and I finallly found where the problem is. I wrote Console.Write() after almost every line in my code.. and the problem is that Somehow I dispose my object before I use it in the drag drop, So I comeout with this idea that an object doesn't become null after being disposed... Maybe someone can clarify my idea, anyway I am quite happy now that my program is working ... Thank you -idos- Thank you for your help, While waiting for the answer I try to read msdn doc and create one project to dragdrop between two control. ( I think if I can handle th ...Show All
Pete Atkinson MeasureString() and DrawPath
MeasureString works fine (mroe or less) on drawString, but when i try to use it on outlined text using GraphicsPath and DrawPath, the returned size is way off. Searched around online, seems a few people have had this problem but there is no solution (that i have found) Any ideas Sometimes i really wonder about myself. I have spent the last couple hours, trying to sort this out, i've come up with splendidly complex ways of getting a box roughly the right size. Only to see that in my drawpath method i was multiplying the text font to draw by 2. whoops Post your code please. ...Show All
GWeston Difficult to fix focus on main form after splash screen....
Hi, I am new to Windows Forms programming.I need to display a Splash screen and then a Login Form. The problem is that I am not able to get the focus onto the Login form after the Splasher.The Login form just blinks in the taskbar around 3 times after the Splasher.What could be the reason My colleague has used 4 forms.... Apploader.cs,Form1.cs,Splasher.cs,SplashForm.cs. ============================================================================= SplashForm.cs contains the following code... private string _StatusInfo = ""; private System.Windows.Forms.Label lStatusInfo; public void ChangeStatusText() { if (this.InvokeRequired) { this.Invoke(new MethodInvoker(this.ChangeStatusText)); return; } lblStatusInfo.Te ...Show All
Kamii47 Scrolling a DataGrid Thru Code
Hi, I am developing a ASP.NET Application using .NET Framework 1.1. I have a data grid control with a scroll bar. When I select any row in the data grid the page gets refreshed. After refreshing I want to scroll the data grid to the last selected item. Is it possible thru code or java script Can anyone help Thanks in Advance Nadanasabapathy.I ...Show All
Dudley Generated DataBinding and ComboBox Problem
Hi, I make use of the automatic databinding in VB 2005. I have got two tables. One is called customers and the other is called WorkingStations. Every Customer is assigned to one WorkingStation. I have created the dataset that displays thw rows from both tables. The customer table contains a column called WorkingStationID that is related to the primary WorkingStation key. Now I created a form that allows me to edit a customers data. I load one single customer by his ID. The basic editing works without any troubles. Now I added a combobox that has following attributes: Source: WorkingStationBindingSource Member: WorkingStationName Valuemember: WorkingStationID Value: Customers.WorkingStationID I load both tableAdapters(the one for the custom ...Show All
xRuntime How to Create a Download Update Form?
Hello, I want to know how to use the System.Net.WebClient in my application. Here is the part of the code: System.Net.WebClient client = new System.Net.WebClient(); client.DownloadFile("http://updates.com/index.xml","c:\\update.xml"); That would download the file "index.xml" and save it in the local computer in drive C under a new name "update.xml". I would like my application to determine the file size of the file to be downloaded. I would like to make a progress bar showing the percent downloaded in the file in relation to its file size. Then after, when the download finishes, a MessageBox will appear stating that the download is completed. Even if the progress bar is not included, that wou ...Show All
