|
Christian Graus wrote: you don't cause infinite recursion
Well I handled that thing...Actually the application works like the 'Reflector'..So the application loops through the classes(and their properties,innerclasses) and initializes objects at run time ..While looping through StackOverflow exception occurs in the case of a dll having many classes and innerclasses. But i found only recursion as the suitable thing and hence could not avoid it
.....
|
|
|
|
|
Hi Graus,
The following code is working perfectly
private void ReadAllControls(Control Parent)
{
if (Parent.HasChildren)
{
foreach (Control Child in Parent.Controls)
{
GetTheme(Child);
ReadAllControls(Child);
}
}
else
GetTheme(Parent);
}
Try it
Software Developer as well as Team Coordinator, Working for eXinfoTech
|
|
|
|
|
Recursive.
By the way, not all controls are in .Controls, ie Menu
|
|
|
|
|
What is meant by hardcoding values into a program? An explanation with brief example will be highly appreciated.
|
|
|
|
|
First of all I would like to advice you to use a thing they call: Google ... it kinda helps alot.
Secondly, To hard code or hard coding (also, hard-code/hard-coding, hardcode/hardcoding) refers to the software development practice of embedding input or configuration data directly into the source code of a program or other executable object, or fixed formatting of the data, instead of obtaining that data from external sources or generating data or formatting in the program itself with the given input.
Hope it makes sense ...
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Thank you so much. It makes a lot of sense, more than what I found on google.
cheers.
|
|
|
|
|
Wikipedia[^] is also your friend (as well as google).
Dave
|
|
|
|
|
I am doing a GUI design right now. I have all the templates with me which have space allocated for controls. I have added form's background as this image and placed controls in the correct slots. Since background is an image, it's getting slight delay in loading the form. I am looking for an alternative efficient way to load the background image. Any thoughts ?
|
|
|
|
|
Hi,
Only thing I can think of right now is double buffering, or maybe use an image instead of the background image of the form ...
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Programm3r wrote: maybe use an image instead of the background image of the form ...
Do you mean image in a picture box ? Picture box is poor in performance.
Programm3r wrote: double buffering
Thanks. I will take a look at this.
|
|
|
|
|
|
Hi all,
I am trying to select the cell of a datagrid as a right click occurs on it .... and I am kinda lost. Can anyone please give me some advice ?
Many thanks in advance
Regardsm
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Handle the CellMouseClick event in which check if the mouse click is of right button and then select the particular cell
.....
|
|
|
|
|
Thanks for the reply ...
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
|
.... and I'm no longer lost
private void dbGrid_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
if (e.Button == MouseButtons.Right)
{
if (e.ColumnIndex != -1 && e.RowIndex != -1)
{
dbGrid.ClearSelection();
dbGrid.CurrentCell = dbGrid.Rows[e.RowIndex].Cells[e.ColumnIndex];
}
}
}
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Hi again,
So after figuring out how to make the right click work, I'm having trouble with the position of the contextmenustrip. The problem is that the menu pops-up at the incorrect locaion. I'm doing the following:
...CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
{
...
contextMenuStrip1.Show(dbGrid, e.Location);
...
}
But the contextmenustrip pops-up at the top right hand corner of the DataGridView ?? Am I doing something wrong, if so what ?
Many thanks in advance
regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
Instead of Show use PointToScreen method...Also i think you have to attach the contextmenustrip to the particular cell like dbgrid.rows[index].Cells[index].ContextMenuStrip = contextmenustrip..
check the syntax
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
|
Just out of curiosity, why would the contextmenu pop-up every second time, that the right-click occurs ??
Another observation, is when I right click on the cell(1) and right-click on another cell(2) and then move back to the previous cell(1) the contextmenu pops-up first time ???
Thanks again.
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
|
HI,
I have seen applications like Reflector that can
perform a self update. How can I replace the currently running executable
with another file downloaded from an update location? I have tried
disassembling Application.Restart() and writing the new file in the process
gap but that does not work. I figure there must be some best practice for
this?
Thanks
tbhattacharjee
|
|
|
|
|
You have the program check to see if it needs to update. If it does, it runs another program that does the update. That way you can actually update the old application.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
I am trying to convert native code to C# through DLLs. The dll works fine when called from C++ but when called from C# (using P/Invoke), it give exception error. Anyhow has any idea what the issue could be. Basically i am working on Math Kernel Library. Any help will be appreciated.
Thanks
|
|
|
|
|
If you're trying to call a dll through p/invoke, best bet is to check that you go the pinvoke signature right.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|