|
On changing the index of the combo box giving the following exception
Invalid operation Exception:
List that this enumerator is bound to has been modified. An enumerator can only be used if the list does not change.
why this exception is coming pls help me!
|
|
|
|
|
Somewhere in that code your enumerating through a collection. Whilst you are doing this you cannot change the enumeration in any way. If you do you'll get that error.
|
|
|
|
|
Hi everybody!!!
How I can use ErrorProvider in DataGrid??? (It is for notice when the input data in some field is failur. In this case you mast see blinking of ErrorProvider in some field)
|
|
|
|
|
Hello,
I need to be urgent.
I need a Solution for the Following Proble.
I need to Export Data in Excel but record size is mre then 65536
which is more than the predefined size of the excel.so i need to
add remaining record in sheet2 when record size is greater than 65526.
Thanks in Advance.
Regards,
Rahul
|
|
|
|
|
rsp7023 wrote: I need to be urgent.
Not nice, considered rude around here.
rsp7023 wrote: I need to Export Data in Excel but record size is mre then 65536
which is more than the predefined size of the excel.so i need to
add remaining record in sheet2 when record size is greater than 65526.
Export out until you have Sheet1 filled up, then create Sheet2 and continue.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
hi,
this is probably not a good thing to ask, but i need help because i'm not an experienced programmer. I am working on writing a 'framework' that allows you to write applications that works on multitouch tables (or surface computers). now the code isn't complicated so most of you would not have trouble understanding it, even if you've never worked with multitouch applications.
no my question is: could someone please have a look at my code and tell me if there is a better, more efficient way to do what i'm doing? or if i could get better performance? or if there is a better approach?
all the application does is load 3 photos, and allow you to rotate/scale/drag is on the screen with your fingers.
the code is available here: http://www.whitespaced.co.za/WPF_MTPhotoApp_SOURCE.zip it won't compile, you'll need more files, but let me know if you wish to compile, then i'll add the link to those files
the code works as follows:
the TouchFramework class gets the finger events from a managed c++ wrapper for unmanaged c++ fingertracker. the is raises the events, any class that has those events get raises as well, in this case TouchCanvas. TouchCanvas checks to see which object was touched and the raises it's own event and passing as parameter the UIElement that was touched. Now all the other classes that has a reference to the current canvas gets that event and checks to see if it is the object that was touched(TouchImage) and does something about it. now this works fine, but the coding is bad, i don't know is a interface would be better. and i also feel to many events are being passed around. (ex. if there are 300 images on screen and you press your finger on any one, all 300 will check if it was the one touched after the TouchCanvas already figured out what was touched.
I would really appreciate any help on this subject as i want to write this as best as possible. i also want the 'framework' to be easily extensible by added new classes, like TouchVideo and so.
Thank you
Donovan
rather have something you don't need, than need something you don't have
|
|
|
|
|
Is there a particular part of your code you are having trouble with?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
ah,great quote!
no i'm not having trouble with the code.i just feel the touchframework and touchcanvas code can be improved,it all just feels so innefficient. i want to find the code issues at the beginning of the project,rather than the end.
rather have something you don't need, than need something you don't have
|
|
|
|
|
Hi all,
I'm creating a program that generates an Excel sheet and am trying to add password protection to it.
I want to make it so when the user initially opens the the Excel file it prompts for a password (so they see no data unless the password is correct).
i've tryed the following code based on a VB example I found but have had little success.
_oWB.Password = "Cmore";
_oWB.SetPasswordEncryptionOptions(
"Microsoft RSA SChannel Cryptographic Provider",
"RC4",
128,
true );
_oSheet.SaveAs( @sFileName,
Excel.XlFileFormat.xlXMLSpreadsheet,
_oWB.Password,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value,
Missing.Value );
Cheers,
Mark
|
|
|
|
|
MarkBrock wrote: I found but have had little success
What is happening? Be a bit more specific.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
If you have Excel.
Click Tools > Options > Security - I'm trying to programmically set the "password to open" under this tab.
If correct. Excel should prompt you to enter a password before you are allowed to view the spreadsheet.
The code above is (my attempt at...) a c# equivalent of the code in this article...
[^]
Mark
|
|
|
|
|
Hi, i've got a problem here. i can't figure out why my form background and also the button change its color when i call the function below. how can i ensure that only the background changes? besides that, in the form i also need to draw and show some circles. How to ensure that when the background color changes, it still there?
public void b1_click(object sender, EventArgs e)
{
clg.ShowDialog();
this.BackColor = clg.Color;
}
|
|
|
|
|
Objects on your form inherit their background color from their container. In other words, if you place a button on your form, the background color will inherit from the form you put it on, unless you set the background color for the button (for example to 'Red').
Try setting the background color of your button to red and your code will work fine.
|
|
|
|
|
|
Hello,
The stringclass itselfe provides some usefull methods, but I think for that purpose you need "using System.Text.RegularExpressions"
All the best,
Martin
|
|
|
|
|
Perhaps this[^] article may help?
/ravi
|
|
|
|
|
Hi all,
i want to implement multicast in c#.
i found lots of example in that..........
but it will show only one message..........
but it the wireless network lots of ip sending messages.....
i had 1 more tool in vc++6.0 it will show around 7 ip in that group sending messages....
wat is the problem... how to handle this in c#
With Regards
Amjath
|
|
|
|
|
hi all,
i want to search a particular text in the list view like if there is text "Cancel The Item" and i want to search search item then i want to make red only Item not the whole , it's like the search we have in wordpad or notepad .
Does anyone has any idea please tell me?
Praveen Sharma
|
|
|
|
|
Next time, please ask your question in English...
loop through your listview items
<br />
foreach (ListViewItem itm in yourListView.Items)<br />
{<br />
if (match)<br />
itm.BackColor = Color.Red;<br />
}<br />
For regular expressions help, see This[^] website
|
|
|
|
|
the code that causes error is boldfaced...see below the inner most loop code.
private void toolStripButton3_Click(object sender, EventArgs e)
{
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// GDI+ still lies to us - the return format is BGR, NOT RGB.
///Cover Image Code
Bitmap bmp1 = new Bitmap(textBox1.Text); ///takes image from openfiledlg textbox1
///takes an object of BitmapData & apply LocBits()
BitmapData bmp1data = bmp1.LockBits(new Rectangle(0, 0, bmp1.Width, bmp1.Height), ImageLockMode.WriteOnly, PixelFormat.Format24bppRgb);
///finds out Bitmap's stride
int stride1 = bmp1data.Stride;
///defines pointer's to scan0 (1st byte of BimapData array
System.IntPtr Scan1 = bmp1data.Scan0;
///end of Cover Image Code
///////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
/// Stego Image code
Bitmap bmp2 = new Bitmap("f:\\bb.jpg");
BitmapData bmp2data = bmp2.LockBits(new Rectangle(0, 0, bmp2.Width, bmp2.Height), ImageLockMode.ReadWrite, PixelFormat.Format24bppRgb);
int stride2 = bmp2data.Stride;
System.IntPtr Scan2 = bmp2data.Scan0;
unsafe
{
///unsafe stego code
byte* ptr2 = (byte*)(void*)Scan2;
int offset2 = stride2 - bmp2.Width * 3;
byte b2;
///end of unsafe stego
////////////////////////////////////////////////////////////////
///unsafe cover code
/// defines a byte type pointer to scan0
byte* ptr1 = null;
ptr1 = (byte*)(void*)Scan1;
/// finds offset of the BitmapData
int offset1 = stride1 - bmp1.Width * 3;
/// defines RGB values
byte b1,index=0;
bool bitt;
int x1, x2, y1, y2;
///iterates through the BitmapData
///end of unsafe cover code
////////////////////////////////////////////////////////////////
for (y2 = 0; y2 <= bmp2.Height; ++y2)
{
for (x2 = 0; x2 <= bmp2.Width; ++x2)
{
b2 = ptr2[0];
////embedding a bitt
for (y1 = 0; y1 <= bmp1.Height; y1++)
{
index = 0;
x1 = 0;
while(index<8 || x1<=bmp1.Width )
{
//////erroenous code
b1 = ptr1[0]; //gives error..access voilation
bitt = GetBit(b2, index);
/// sets LSB
ptr1[0] = SetBit(b1,6,bitt);
////end of erroneouscode //increments index by 1 ++index;
x1 = x1 + 1; ;
/// increments the pointers
ptr1 += 1;
} ///end of while
/// incremnets the pointer by offset value
ptr1 += offset1;
} ///end of outer for loop
}///3rd for loop
ptr2 += 1;
}//2nd for loop
ptr2 += offset2;
}//1st for loop
//end of unsafe1....
/// end of stego Image Code
bmp1.UnlockBits(bmp1data);
bmp2.UnlockBits(bmp2data);
/// Displays grayscale picture in picturebox.
pictureBox1.Image = bmp1;
///End of Embedding.....
}
I am getting B.S. degree in Computer Science.And want to enhance career in Software development.
|
|
|
|
|
Hi Chetan
Well i went through your code which was given in one of your articles
"Enumerating Objects in C#" posted on "8 May 2007". No doubt that the article is very easy to understand but Well when i run this code
it gave the following error
"the Cannot implicitly convert type 'test.Str.StrEnumerator' to 'System.Collections.IEnumerator'. An explicit conversion exists (are you missing a cast?)"
May you please tell me how to get rid of this?
Thanks and Regards
Abhishek
abhishek@entech.us
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace test
{
class Demo
{
public static void Main()
{
Str spp = new Str();
foreach (string i in spp)
System.Console.WriteLine(i);
}
}
class Str : IEnumerable // To impliment GetEnumerator method
{
string[] str_arr = new string[5] { "one", "two", "three", "four", "five" };
public IEnumerator GetEnumerator()
{
IEnumerator r = new StrEnumerator(this);
return r;
}
class StrEnumerator
{
int index;
Str sp;
public StrEnumerator(Str str_obj)
{
index = -1;
sp = str_obj;
}
public object Current
{
get
{
return sp.str_arr[index];
}
}
public bool MoveNext()
{
if (index < sp.str_arr.Length - 1)
{
index++;
return true;
}
return false;
}
public void Reset()
{
index = -1;
}
}
}
}
//error -- An explicit conversion exists (are you missing a cast?)
Abhishek
Mumbai
|
|
|
|
|
abhishek.mumbai wrote:
class StrEnumerator : IEnumerator
|
|
|
|
|
Use the forum on the article page itself if you want to communicate with the author. There is no guarantee that the author will be reading this forum, but if you post on their article's forum then they will get an email to tell them a message exists.
Upcoming events:
* Glasgow: Mock Objects, SQL Server CLR Integration, Reporting Services, db4o, Dependency Injection with Spring ...
"I wouldn't say boo to a goose. I'm not a coward, I just realise that it would be largely pointless."
My website
|
|
|
|
|
Hello guys,
I have a datagrid control in which I have 2 relationships to make a 3 level nested datagrid, the problem is I need to know in what level I'm now, please save my a$$ as I'm in a mission now and have no time
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
I need to compile the solution written in windows application using C#.
My build file is as follows:
<?xml version="1.0" ?>
<project name="TestNANT" default="build" basedir=".">
<target name="build">
<solution solutionfile="TestNANT.sln" configuration="Release" >
</solution>
<property name="expected.output" value="bin/${configuration}/TestNANT.exe"/>
<fail unless="${file::exists(expected.output)}">Output file doesn't exist in ${expected.output}</fail>
</target>
</project>
when i execute 'nant' command in command prompt, i get the following error:
BUILD FAILED
Microsoft Visual Studio.NET 2005 solutions are not supported.
Total time: 0 seconds.
Could anyone please help me out here or tell me the correct way to write the script...
Thanks...
Deepa
-- modified at 5:15 Wednesday 18th July, 2007
|
|
|
|