|
hi,
how to get the id of the row to be updated when the button is outside the grid view
|
|
|
|
|
If you want to do mass deletes or something like that I usually put a check box column. So I loop through the gridview to see which checkboxes are checked and then I know which rows to delete or whatever you are trying to do.
Hope that helps.
Ben
|
|
|
|
|
Hi,
is it possible to catch the handle of the Dr.Watson dump??? I will start mt.exe (Process.Start) from out a queue to embed a manifest on many .exe files. On some exe files mt.exe don't work and gives an Watson Window. I want to cancel the Watson window so my app don't still stand.
I can't catch an Exception on Process.Start();
Thanks
|
|
|
|
|
Im implementing undo option in ma image processing application for that I have made an array of 20 bitmaps
b4 every action I use the code to record the bitmap in array
<br />
if (bmpUNDOLEVEL[ucount] != null)
bmpUNDOLEVEL[ucount] = null;<br />
bmpUNDOLEVEL[ucount] = new Bitmap(origBitmap);<br />
ucount++;<br />
if (ucount == 20)<br />
ShiftUndoLevel();<br />
in undo button Im using
<br />
private void undoBtn_Click(object sender, EventArgs e)<br />
{<br />
if (ucount < 1)<br />
{<br />
origBitmap = null;<br />
origBitmap=new Bitmap( bmpUNDOLEVEL[0]);<br />
panel3.Invalidate();
ucount = 0;<br />
}<br />
else<br />
{<br />
origBitmap = null;<br />
origBitmap =new Bitmap( bmpUNDOLEVEL[ucount - 1]);
<br />
panel3.Invalidate();
ucount--;<br />
}<br />
if (ucount == 0)<br />
undoBtn.Enabled = false;<br />
}<br />
shiftundlevel shift the bitmaps once all 20 indexes of array is full;
public void ShiftUndoLevel()
{
ucount--;
bmpUNDOLEVEL[0].Dispose();
for (int i = 0; i < 19; i++)
bmpUNDOLEVEL[i] = bmpUNDOLEVEL[i + 1];
}
}
Can u figure out why is dis xception comin..........
|
|
|
|
|
ShiftUndoLevel() is wrong; check your for boundaries.
|
|
|
|
|
Luc Pattyn wrote: ShiftUndoLevel() is wrong; check your for boundaries.
well I have checked them I cant figure it out!!!!!!!!!
can u suggest anything!!!!!!!!!
|
|
|
|
|
Y u fl u nd to tlk in txtspk? It's very annoying.
Your code looks slightly suspect to me. Let's break it down, section by section:
if (bmpUNDOLEVEL[ucount] != null)
bmpUNDOLEVEL[ucount] = null;
bmpUNDOLEVEL[ucount] = new Bitmap(origBitmap);
ucount++;
if (ucount == 20)
ShiftUndoLevel(); Why are you doing it this way? Why do you add the record in and then reorder your undo stack? Surely you would be better off reordering the stack and then performing the bitmap assignment.
Second, I would recode your undo stack to use a List<Bitmap> instead of an array list. Then, your code would look something like this:
private List<Bitmap> bmpUndoLevel = new List<Bitmap>();
private void AddToUndo(Bitmap bmp)
{
if (ucount == 19)
ShiftUndoLevel();
else
ucount ++;
bmpUndoLevel.Add(bmp);
}
private void undoBtn_Click(object sender, EventArgs e)
{
if (ucount == 0) throw new ArgumentOutOfRangeException("ucount");
origBitmap = (Bitmap)bmpUndoLevel[--ucount];
panel3.Invalidate();
if (ucount == 0)
undoBtn.Enabled = false;
}
private void ShiftUndoLevel()
{
bmpUndoLevel.RemoveAt(0);
} Note that this isn't the complete code, but it should give you a starter for what to look at. BTW - repeatedly creating new Bitmaps is not the best way to manage them. Old ones need to be disposed.
|
|
|
|
|
Im robbins, and i need one help.
I have one list box filled with the form Names available in my project.
The user will select any one of the form he/she wants.
I want to display this selected form on a button click.
i dont want to use the select case statement, because the number of forms may vary in the future.
Please anyone gimme a solution to this issue.
thanks and regards,
Robbins
Robbins
|
|
|
|
|
hi,
I'm assuming you're using .NET 2.0
Use the List<> class like this.
<br />
List<Form> lstForms = new List<Form>();
Fill this list first:
lstForms.Add(new myForm());
Use this to fill you're listbox:
<br />
foreach(Form frm in lstForms)<br />
myListBox.Add(frm.Name);
The indexes of the list and listbox match now , opening the selected form would be:
lstForms[myListBox.SelectedIndex].Show(); //or showDialog();
If you are using .NET 1.1 use the arrayList class. You would have to cast the forms into object though.
Gideon
|
|
|
|
|
Im robbins, and i need one help.
I have one list box filled with the form Names available in my project.
The user will select any one of the form he/she wants.
I want to display this selected form on a button click.
i dont want to use the select case statement, because the number of forms may vary in the future.
Please anyone gimme a solution to this issue.
thanks and regards,
Robbins
Robbins
|
|
|
|
|
If you don't want to do it via a select list, then you probably need to store the class names and use reflection to create them.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
can u pls explain the way how it can be done using reflection?
i will have only the name of the forms available and the selected form's name.
it will be string variables.
i need to refer the corresponding forms using this string variables..
regards,
robbins
Robbins
|
|
|
|
|
Let me ask you something first:
How do you get the values that will be displayed in the list?
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
the list will be from the Config file.
Robbins
|
|
|
|
|
Then I suggest that you use a custom config section and define a text that will be displayed in the list and a type that you can use to instantiate an instance of the according form.
Something like:
<FormSelection>
<Form text="My first Form" type="MyNameSpace.MyFirstForm, MyAssembly" />
<Form text="My second Form" type="MyNameSpace.MySecondForm, MyAssembly" />
</FormSelection>
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
similar is my config file. and the list is populated properly.
but then, in the button click event, i tried to create an object of the selected form. there it gives an error saying
"Value of type 'String' cannot be converted to 'System.Windows.Forms.Form'."
Robbins
|
|
|
|
|
has to be something like:
string typeString = ... string from config;
Type type = Type.GetType(typeString);
Form form = (Form)Activator.CreateInstance(type);
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
Thanks a lot dude.
it works.
regards,
robbins.
Robbins
|
|
|
|
|
I'm happy I could help.
I'd be glad if you would rate my posts
Happy programming
Urs
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
I rated your replies.
because it helped me building this configurable User Interface.
i got the exact answer i wanted.
once again, thanks to you.
regards,
robbins.
Robbins
|
|
|
|
|
Hi,
my question is how can i prevent that the user move my window of the workarea ?
and how can i tell my window that it shall be stick to the edge of the workarea when its close to it
|
|
|
|
|
How can I get to see the values coming into LPT1 378H? Is there a general method belonging to a class to call?
Thanks
Samuel
|
|
|
|
|
of cource, you need to use the dll file inpout32.dll.
[importDll....]
if this is not enough for you, i can send you a code which makes the work.
|
|
|
|
|
I have the dll file...but I can't figure out how to listen to the port..I have void PortAccess(Address)... why is it void??? how to I read than? the output is ok....but I cannt read the port
Samuel
|
|
|
|
|
hmmm, I have the following in the class is it correct
public class PortAccess
{
[DllImport("inpout32.dll", EntryPoint="Out32")]
public static extern void Output(int adress, int value);
[DllImport("inpout32.dll", EntryPoint="Inp32")]
public static extern voidInput(int adress);
}
shouldnt the last line be
public static extern int Input(int adress);
|
|
|
|