|
If you want to clear the entire entire canvas, just call your Graphics object's .Clear() method.
If you want to clear just the line itself, you'll have to create a new pen the same color as the canvas background, then use it to redraw the line exactly the same way it was drawn originally. If your line intersects with other lines or graphics objects, it'll draw a background colored loine through them.
The only other way to do this would be to redraw everything onto the canvas that was originally drawn, but don't draw the line that you want to erase.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have a web application that needs to modify some files in the web folder. I have notice that after installation, the ASP.Net account doesn't have modidy permission and have to grant it manually. Is there a way for me to grant the ASP.Net account modify permission during installation throught programming or setting so properties? Thanks.
|
|
|
|
|
It's not a good idea to modify the permissions on the site's parent folder. A better idea would be to create a subfolder off the site root and put your modifiable files in there.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I have set the launch condition in my installer to check for the .Net Framework. Is there a way for me to run the dotnetfx.exe if the condition fails. I want to run it automatically or programmatically from the installer. I can launch an executable programmatically, but where do I place the code for it? I perfer to do it automatically though.Thanks.
|
|
|
|
|
I believe you can get a merge module from Microsoft, which means your installer will install the .NET framework for you. Personally, I write a little exe to run my MSI and anything else I want to run.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Where on the MS website can I find the merge module? I have typed in different combination of the words merge module, .net framework, and dotnetfx.exe, but can't find anything relevant. After I have the merge module, do I just added it to my installer project? Thanks.
|
|
|
|
|
This[^] is probably your best source of info
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks for the help Christian, I got it to work.
|
|
|
|
|
i've a list view with large icon view.
i've to select multy objects and make a drop into another one.
How?
|
|
|
|
|
Hi Everyone,
I am making an application for language specification and using satallite assembly.
If we use satallite assembly means there is no need to recompilation of application.
What I am doing that is given below step by step.
1. Created file like string.txt,string.de-DE.txt,string.ja.txt
2. compile all txt file with "resgen.exe" at command prompt like "resgen string.de-DE.txt string.de-DE.resources.
3. Again compile all resources file with "al.exe" like "al /t:lib /embed:strings.de-DE.resources /culture:de /out:myApp.resources.dll"
4. Created folder in my application for different language specification like "de-DE","ja"(Folder name)
5. Put file in this folder like for "de-DE" folder for myApp.resources.dll,string.de-DE.resources,string.de-DE.txt
6. In coding part "myapp.cs"
a) //static ResourceManager rm = new ResourceManager("myapp.string", Assembly.GetExecutingAssembly());//myapp is "namespace"
static ResourceManager rm = new ResourceManager("myapp.string",(typeof(Class1).Assembly));//string is "base name"
b) cultureinfo and switch case
7. Question is that if i don't make these resource file as satallite assembly then it works fine but if i make these resource file as
satallite assembly and put the resource file and dll in folder then it doesn't work.
8. If i run this application it pick up default one english language specification but not pick up german or any other language.
9. I am following each step that is given in MSDN.
Thanks
|
|
|
|
|
I am new to C# and am trying to find a way to change the text displayed in a given ColumnHeader in a DataGrid. I would like to display text that is "human understandable" rather than some of the cryptic field names some folks have put in the Database. That I can determine the Columns Collection doesn't have a property that allows this. I am probably just missing it somewhere. If anyon can point me in the right direction, I would appreciate it.
Thanks
Ken Jinks
|
|
|
|
|
|
I am not an expert by any mean but the method worked best for me and was fairly easy was to use alias in the select statement, something like this:
SELECT UID as [User ID], UNAME as [User Name], UADD as [User Address]
FROM tblUserInfo
Hope it will help.
|
|
|
|
|
jinksk wrote:
I would like to display text that is "human understandable" rather than some of the cryptic field names some folks have put in the Database.
u could put column styles for the columns
then give the header name as anything u want.
|
|
|
|
|
I have a dataGrid in my windows app which i have a colum name amount and a column named Total.
I need to show Total after every transaction. Can someone tell me how can I do that at run time?
ID | Date--| Description | Transaction Amount | Total<br />
01--1/1/01-----xyz--------------10---------------10<br />
02--1/2/01-----xyz------------(-05)--------------05<br />
03--1/3/01-----xyz--------------25 --------------30
Very similar to a check book register. Hope that helped.
Best Regards,
Rob
|
|
|
|
|
Is this a web or windows app ? If web, then handle the itemdatabound event, and store a running total. Otherwise, I'm not sure if winforms has this event, if not, you could always add it to your data table before binding.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
This is a windows app. Can you help me with that I am not much knowldgeable when it comes to working with windows datagrid. Sure would appreciate it . Thanks.
|
|
|
|
|
The windows grid doesn't have such an event. I think you need to add a column to your grid, then use foreach to step through each row, and insert your running total. Then the grid will display the total like any other column.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks a lot for your reply. Could you please post as to what the for each statement would look like? like I said I am really illiterate when it comes to working with datagrids
Once again I do appreciate your replies.
Best Regards,
Rob
|
|
|
|
|
if you had a datagrid with a row called price, and a new row called total:
int total = 0;
foreach( DataRow row in myGrid.Rows)
{
total += Convert.ToInt16(row["price"]);
row["total"] = total;
}
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thank you very much, you are always a great help.
|
|
|
|
|
I'm doing this piece of code which should copy the non-null elements in btnArray to the tempArray. Afterwards it should copy the elements of tempArray back to btnArray in order to get rid of the null elements and restructure the array.
However i'm getting the following exception:
"Specified argument was out of the range of valid values."
"Parameter name: Index was out of range. Must be non-negative and less than the size of the collection."
I can ofcourse interpret this, but i can't see where i'm making the mistake, i even tried doing the calculations manually and they seem to fit.. or else i'm doing something wrong
If anyone could point out the mistake i'm making i'd be very thankful
private void CopyArray()<br />
{<br />
try<br />
{<br />
if(btnArray.Count > 0)<br />
{ <br />
int iCounter = 0;<br />
<br />
for (int iButtonIndex = btnArray.Count; iButtonIndex > 0; iButtonIndex--)<br />
{<br />
if (btnArray[iButtonIndex-1] != null)<br />
{<br />
tempArray[iCounter] = btnArray[iButtonIndex-1];<br />
iCounter++;<br />
} <br />
}<br />
<br />
for (int iButtonIndex = 0; iButtonIndex < tempArray.Count; iButtonIndex++)<br />
{<br />
btnArray[iButtonIndex] = tempArray[iButtonIndex];<br />
}<br />
}<br />
<br />
else<br />
{<br />
MessageBox.Show("(COPY) ARRAY IS EMPTY");<br />
}<br />
}<br />
<br />
catch(Exception ex)<br />
{<br />
MessageBox.Show("ERROR: " + ex.Message,"Error",MessageBoxButtons.OK,MessageBoxIcon.Error,MessageBoxDefaultButton.Button1);<br />
}<br />
}
|
|
|
|
|
Where is tempArray created ? You'd do better to shove them into an arraylist, then call the ToArray method to get out an array that is the right size.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Can you show us the code where you declared
tempArray.
|
|
|
|
|
The tempArray and ButtonArray comes from here in the main form
<br />
ButtonArray btnArray;<br />
ButtonArray tempArray;<br />
<...><br />
private void Form1_Load(object sender, System.EventArgs e)<br />
{<br />
btnArray = new ButtonArray(this);<br />
tempArray = new ButtonArray(this);<br />
}<br />
Both ButtonArrays come from this class
using System;<br />
<br />
namespace ButtonArray<br />
{<br />
public class ButtonArray : System.Collections.CollectionBase<br />
{<br />
private readonly System.Windows.Forms.Form HostForm;<br />
<br />
public System.Windows.Forms.Button AddNewButton()<br />
{<br />
System.Windows.Forms.Button aButton = new System.Windows.Forms.Button();<br />
<br />
this.List.Add(aButton);<br />
<br />
HostForm.Controls.Add(aButton);<br />
<br />
aButton.Top = Count * 25;<br />
aButton.Left = 100;<br />
aButton.Tag = this.Count;<br />
aButton.Text = "Button " + this.Count.ToString();<br />
<br />
<br />
aButton.Click += new System.EventHandler(ClickHandler);<br />
<br />
return aButton;<br />
}<br />
public ButtonArray(System.Windows.Forms.Form host)<br />
{<br />
HostForm = host;<br />
this.AddNewButton();<br />
}<br />
<br />
public System.Windows.Forms.Button this [int Index]<br />
{<br />
get<br />
{<br />
return (System.Windows.Forms.Button) this.List[Index];<br />
}<br />
<br />
set<br />
{<br />
this.List[Index] = value;<br />
}<br />
}<br />
<br />
public void RemoveX(int iRemoveX)<br />
{<br />
if (this.Count > 0)<br />
{<br />
HostForm.Controls.Remove(this[iRemoveX-1]);<br />
this.List.RemoveAt(this.Count-1);<br />
}<br />
}<br />
<br />
public void RemoveButton()<br />
{<br />
if (this.Count > 0)<br />
{<br />
HostForm.Controls.Remove(this[this.Count -1]);<br />
this.List.RemoveAt(this.Count -1);<br />
}<br />
}<br />
<br />
public void FlushArray()<br />
{<br />
if (this.Count > 0)<br />
{<br />
for(int iButtonIndex = this.Count; iButtonIndex > 0; iButtonIndex--)<br />
{<br />
HostForm.Controls.Remove(this[iButtonIndex-1]);<br />
this.List.RemoveAt(iButtonIndex-1);<br />
}<br />
}<br />
}<br />
<br />
public void ClickHandler(Object sender, System.EventArgs e)<br />
{<br />
System.Windows.Forms.MessageBox.Show("You have clicked button " + <br />
((System.Windows.Forms.Button) sender).Tag.ToString());<br />
}<br />
}<br />
}
|
|
|
|