Answer Questions
zuoliang How can I set excel.cells[1,1].backColor when Exporting ?
I want to export data to Excel App and format this such as backcolor cell ... but I dont know how to do. Please help me solve this problem ! Thanks a lot ! ...Show All
LOTG Making my own exceptions
Hy! I want to create my own exception. For example, I want to have InvalidTokenException. How should I do this I know I need to create class that inherits Exception class, but don't know what to do then... Hi Bruno This tutorial will help you: http://www.c-sharpcorner.com/UploadFile/susanabraham/CustomExceptionHandling06022005011154AM/CustomExceptionHandling.aspx Thanks You may want to check out the following link for guidance on creating and using exceptions: http://msdn.microsoft.com/library/default.asp url=/library/en-us/cpgenref/html/cpconerrorraisinghandlingguidelines.asp -Tom Meschter Software Dev, Visual C# IDE A class that inherits Exception is the minimum you need to d ...Show All
smargroth help with the following code
I'm new to .net and just learning c#. I have the following code in vb and want to convert this to c# Public Class PositionData Private strText As String Private strUrl As String Public Sub New(ByVal strDisplayText As String, ByVal strURL As String) Me.strText = strDisplayText Me.strUrl = strURL End Sub Public ReadOnly Property DisplayText() As String Get Return strText End Get End Property Public ReadOnly Property URL() As String Get Return strUrl End Get End Property End Class Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim MenuItems As New ArrayList MenuItems.Add(New PositionData("About Us", "About.aspx")) Men ...Show All
applepie Deploying Web Site via "Copy Web Site"
Hello, I've been developing a web site for a few weeks with a fair bit of DB work in it. The mdb file (sql express 2005) has grown to about 20Mb. When I go to deploy the site using FPE through the Copy Web Site method the IDE hangs on the DB and becomes unresponsive to the point of having redraw hangs etc. I have been able to deploy the rest of the site (and other sites, including those with smaller DBs) through selectively picking files/dirs and moving them to the server. Basically, though, a computer reboot, start IDE, copy web site, select DB & copy to remote kills the IDE everytime on this site. On some other smaller DBs I get the unresponsiveness, but after a few minutes it tries to redraw a bit, then eventually res ...Show All
Brant Yin casting
hey all, Just a quick question about casting and how it works. if is do String s = (string)someobject, what happens in the background i.e. some method is invoked intternally to convert the object to a string or what How does this work I tried to find the answer but no luck. Please help . Thanks sunny Hi it's not some hidden method... i'll try to give you an explanation that's not really technical but which can give you an idea of what i mean :) at runtime the type of the object is known... the object in itself is accessed via a "type interface" (interface meaning the collection of methods, properties, etc; this is not the c# interface) which specifies what methods, properties and so on you can access ...Show All
hrubesh Number Combinations
Ok. What I need is a method that discovers all the different combinations of any give set of numbers. For example, if my numbers were 1, 2, 3 all the possible combinations would be 123 132 213 231, ect. Can someone help A simple method would be appreCiated. In those examples I have to add classes. That is what I am trying to avoid. Here is a simple, recursive solution (up to you to implement it): - If you're going to construct all the possible combinations of n characters, all you need to do: - Find all the possible combinations of n - 1 other characters, and prepend the n-th charachter to that result. Here's an example in php: function permutations ( $string ) { $results = array(); // only 1 letter -> o ...Show All
AtomZ .be Passing object as value
Hi you all, rearding the following code: <code> ArrayList parties = new ArrayList (); ArrayList arrayAux = new ArrayList (); arrayAux.Add(( Point )outterPoints[outterIndex]); arrayAux.Add(( Point )innerPoints[( int )pointsInDistance[0]]); arrayAux.Add(( Point )innerPoints[( int )pointsInDistance[1]]); arrayAux.Add(( Point )getPartyCenter(arrayAux)); parties.Add(arrayAux); arrayAux.Clear(); </code> If I print the values in the parties ArrayList I wont get any values, but If I instead do the folowing: <code> ... parties.Add(arrayAux.Clone()); arrayAux.Clear(); </code> I will get the values I am expecting. Are the array being p ...Show All
chakravarthy_b New to programming, need help starting this program. Any suggestions??
I had no trouble creating the form, but I don't know where to begin with the code. Any ideas "Piecework workers are paid by the piece. Workers who produce a greater quantity of output are often paid at a higher rate. Use text boxes to obtain the person's name and the number of pieces completed. Include a Calculate button to display the dollar amount earned. You will need a Summary button to display the total number of pieces, the total pay, and the average pay per person. A Clear button should clear the name and the number of pieces for the current employee and a Clear All button should clear the summary totals after confirming the operation with the user. Include validation to check for missing data. If the user clicks on the Ca ...Show All
n3zdh passing an event to a Compossite control
How I can pass an event to a compossite control What do you mean 'pass an event' For example, I have textbox and dropdown, and want that they are only a control, and desire to capture the SelectedIndexChange of dropdown but although I make a ' Override does not recognize it, never enters Is it that you’ve got a control on your composite control (aka user control) and you want events raised by it to be also visible by the users of the user control If that is the case... you’ve got two main options, you can either make the internal control (of the user control) publicly accessible to users of the user control so that external code can register for events directl ...Show All
rayms Newbie Question: creating GIF images from c#
all, I am new to graphics programming in c# and am looking for a tutorial that will take me from creation of a graphic through exporting it as a gif (or jpeg). I have kind of figured out the creation of the graphic using System.Drawing but am not sure where to go from here. Anyone solved this problem before Many thanks in advance. Kevin how to make it transparent I t depends on where you are coming from with the graphics you have created. Here is a simple demostration of using a System.Drawing.Bitmap object: public static void SaveImageAsFormat() { // Create Test Bitmap Bitmap bitmap = new Bitmap(100, 100); // Draw somet ...Show All
raj.ramesh Multidimensional Arrays
Ok, my book really sucks I think. After struggling with an example in the book, I looked in the MSDN and searched these forums. I believe my book is wrong when it shows: int[,] student = new in[4][3]; I tried doing it that way but it errors. int[,] student = new int[5,4]; gives me no error and works. I am going to go with that. Unless someone can tell me that int[,] student = new in[4][3]; is indeed a correct format or what kind of a typing error it could be... The following also seems to be in the wrong format: int[][] x = { { 2, 3 }, { 4, 5 }, { 6, 7 } }; I don't think you can do it that way... You are more than welcome any time! Best Regards, Ok, now I almost have everything figured out wi ...Show All
Jassim Rahma Formatting an Entire Solution off of a vs.settings file
Wanted to see if anyone has any ideas. At work we have started developing some coding standards, so all of our code will look somewhat similar(braces, variable naming). One thing we cannot agree on is the location of braces...some of us like them on the same line, some on the next. And both sides of this are unwilling to compromise. I was wondering if there's anyway upon opening a solution I could run my settings file against it(so all braces are on the same line)...but then when i finish up a project I could run a different settings file(so all braces are on the next line) to match our standards. Or Vise Versa for a different developer... Thanks Hello All. Michael: No, you don't understand. Ma ...Show All
sandeep437 Refresh Property Grid Values
Sorry, but I had to repost this in the C# forum because no one answered me in the Windows Forms forum. Say I have an object, "oFoo", and I assigned oFoo to a PropertyGrid on my form. oFoo also has a .CurrentValue property. If I have a TrackBar (tBar) on my form, and when the user scrolls the TrackBar, oFoo's .CurrentValue is updated respectively. How do I refresh the CurrentValue so that it shows up correctly in the PropertyGrid Right now, the only way I can do that is by refreshing the entire PropertyGrid, but I would think there would be a better, more standard way of doing this. I've tried using RefreshProperties(RefreshProperties.All), but it doesn't even refresh the value in the property grid, so I'm pretty stuck ...Show All
Kevin Rodgers Troubleshoot in installing windows service
Hi, somebody please help me out............ actually i wrote my windows service and there are no build errors. then i opened the command prompt of VS1.1 and tried to install UTIL Asmos_service.exe I got the result as Install has completed .but the service is not found in the computer management window!!!!! What would be the problem Hi I have small problem,I want to install my service with out using commands like installutil service.exe, I want to do it through programming,Is it possible to install through programming or is there any other way to do it.plz help me on this problem. Regards GovardhanReddy If your service applicatio ...Show All
Javahar How to display output using for loop in TextBox?
A simple question: for ( int i = 0; i < 10; i++) { textbox1.Text = i.ToString(); } I want to display 1 2 3 4 ...9 in textbox. However, the codes above only displays 9. Can anyone help Here's what the documentation for XmlNode.InnerText property says: "Gets or sets the concatenated values of the node and all its child nodes. " ( http://msdn2.microsoft.com/en-us/library/system.xml.xmlnode.innertext.aspx ) So you are getting the <product> nodes and the InnerText property will return all the text from them in one line. That's way you get two lines, one if the first product details and another one for the second product details. To make it work ri ...Show All
