|
Ok, I found it:
<br />
if(e.Column == 0)<br />
{<br />
}<br />
else if(e.Column == 1)<br />
{<br />
}<br />
Ward
|
|
|
|
|
Hi
I have a COM DLL(C++ Code), I am calling this dll from a C# application.
Is it possible to debug the c++ code from C# application?
Regards
Sarma
|
|
|
|
|
hi
i am working on wtsapi32.dll to get mad address of client that connect to trminal server.
i use wtsclienthardwareid = 13 . but evry time i get a diffrente number .any one can help me.
in generall what is wtsclienthardwareid and if it is mac address how can read it. i am writing my program in c#.thx
|
|
|
|
|
Hi all,
i have problem with combobox collection items. i need to check all entrys in combo box with foreach, i know the way but i dont know the exact class for combo box items(like ListItem).Thank u.
Best Regards,
ranandbe.
-- modified at 1:20 Wednesday 7th June, 2006
|
|
|
|
|
try out following
for(int i=0;i < comboBox1.Items.Count;i++)
{
MessageBox.Show(comboBox1.GetItemText(comboBox1.Items[i]));
}
rahul
-- modified at 1:39 Wednesday 7th June, 2006
|
|
|
|
|
thank u for replying, now i work with the same what you send but i want to know using foreach statement.
Thanks & Regards.,
ranandbe
|
|
|
|
|
i don't think that it is possible to iterate
through foreach becouse i didn't found any
class for combobox items.
rahul
|
|
|
|
|
In a combo box the items are just strings so you can do this:
foreach (string itm in comboBox1.Items)
{
MessageBox.Show(itm);
}
HTH
|
|
|
|
|
MCSD-Gandalf wrote: In a combo box the items are just strings...
Not always true.
The Items property is an ObjectCollection because you can stuff whatever you want in the collection, and render the Items yourself in a custom drawing routine. It's usually strings, but not always.
Share and enjoy.
Sean
|
|
|
|
|
Very true.
Of course HOPEFULLY if you have stuffed something else in there you know what it is and can write the appropriate foreach loop. And if not I guess you can always treat everything in there as an object and write the foreach loop that way.
Guess I need to be a bit clearer around here with all you guru's watching !
Thanks!
Gandalf
|
|
|
|
|
MCSD-Gandalf wrote: Guess I need to be a bit clearer around here with all you guru's watching
The comment wasn't so much for you; it was intended for people who are less well informed who may read the thread later. I don't usually presume to correct MCSDs.
Share and enjoy.
Sean
|
|
|
|
|
I want to ask that if I want to go to last child folder of any root folder..How can i do that...?
Following example will help to understand my prob.
like- c:\Data\Data1\Data2\Data3
c:\Data\Data1a\Data1b\Data1c
in this data is root folder in which if has 2 sub folders.
Now i want to reach folder Data3 and Data1c
foreach (string directory in Directory.GetDirectories(folderPath))
By using this code I can reach upto Data folder not inside of this folder.
This will help u most.
Thanks,
Hitesh
Hitesh Mangal
|
|
|
|
|
try this:
string temp= folderpath.Substring(folderpath.LastIndexOf("\\"));
this will get u the name of last folder...
then use it in what ever way u want..
abhinav
|
|
|
|
|
Friends,
I am creating a dialog box using Windows Forms. I want a *default button* on my dialog box i.e whenever user presses *enter* key, the button even gets processed. But i don't want my dialog box to get closed on the button press event, instead it should perform some custom task. How can i do so ?
Imtiaz
|
|
|
|
|
try to use
forms AcceptButton property to set default button
rahul
|
|
|
|
|
Hello all,
pls i wanna need know if i created 5 new instance of a class when .net make allocation for these objects does the memory location for each new object consists of its attributes only and in this case th methods for the five objects in memory exists all only once and each of the five objects can call them OR for the five instances each one has the same code of methods exist separetly (i.e the code for methods exist in memory five times each one within each instance's memory space)
??????????????????
|
|
|
|
|
Please use punctuation to separate the sentences from each other. It would make what you write much easier to understand. (Perhaps you should have someone look at your keyboard too, the question mark key seams to get stuck. )
The methods exist only once in memory.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa wrote: The methods exist only once in memory.
But mostly twice (unless inlined)
|
|
|
|
|
thanks alot for ur answers . it really helped me more
|
|
|
|
|
i want to use a function defined in a win32 dll.
which is defined as below:
void Func1(int a,int b,USHORT ** VarArray);
in C#, which data type should i use for the parameter " USHORT ** VarArray "?
|
|
|
|
|
I suppose ushort [][] VarArray
|
|
|
|
|
i have the dllimport as below:
[DllImport("DS40xxSDK.dll")]
private static extern int SetOsdDisplayModeEx(IntPtr hChannelHandle,int color,bool Translucent,int param,int nLineCount,ushort[][] FormatArray);
and call it as below:
private void myFunc()
{
int number=OSDStrings.Length;
ushort [] [] FormatArray=new ushort[number][];
for(int i=0;i
|
|
|
|
|
I have a treeview which lists all the chapters of a book. Whenever the treeView is selected, the program is supposed to paint the text of the entire chapter onto a tabpage.
*******************************************************************************
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
{
// a query is run here to produce a result of text from a certain chapter and then import it to a chap_lines string array
tabPage1.Paint += new PaintEventHandler(tabPage1_Paint);
}
private void tabPage1_Paint(object sender, PaintEventArgs e)
{
y = 8;
Graphics g = e.Graphics;
foreach (string line in chap_lines)
{
g.DrawString(line, new Font("Courier New", 10, System.Drawing.FontStyle.Regular), new SolidBrush(Color.Black), 3, y);
y = y+20;
}
}
*******************************************************************************
The problem is that the text is not painted until the next chapter node is selected. Chapter 1 is okay as it is the default node. But if I then select chapter 3, those text of chapter 1 stay there. The text of chapter 3 is not displayed until another chapter is selected.
The thing is when I debug the program setting the breakpoint at "tabPage1.Paint += new PaintEventHandler(tabPage1_Paint)", it gives me the correct result. But if I set the breakpoint anywhere in the tabPage1_Paint event, it can never get out of itself. Why is that?
How can I display its correct text once a chapter is selected?
Also, I have set the tabPage1.AutoScroll to true but it still doesn't scroll to display those lines that are not visible to the tabPage1 area.
-- modified at 22:07 Tuesday 6th June, 2006
|
|
|
|
|
Don't add the eventhandler to the paint event from the AfterSelect event. That should be done only once, preferably in the Load event. Now you are adding a new handler every time you select a chapter, which means that the tablPage1_Paint will be called multiple times whenever the control needs to be redrawn.
To cause a control to be redrawn, you use the Invalidate method of the control.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks!
But I want the user to choose what chapter they want to read. If I put the eventhandler in the Load event, it would happen only once??? Well, I think I can do it for the 1st chapter (as default page) but how about the rest of the chapters?
|
|
|
|