|
rockyl wrote: but I am not getting the same color as if system is giving by default.
Are you using SystemColors.HighlightColor ?
|
|
|
|
|
No I am not using this color. Will this solve my purpose?
Rakesh
|
|
|
|
|
This colour changes automatically to reflect the highlight colour (used when the TreeView item is selected) defined by the user in the Display Properties of Windows. So it is the same colour as the TreeViews selected node colour.
|
|
|
|
|
|
SystemColors.Highlight has solved my purpose.
One more thing I am looking for is: I want to have some gap between each node of my tree. I have used indent property for this but there is no effect. Can you tell me way?
Thanks in advance:
Rakesh
|
|
|
|
|
Indent is the indentation from the left of the parent node, not the seperation between nodes, look for something like NodeHeight or a property with Height in it (excluding the ones relating to the control). I think there is one.
|
|
|
|
|
HI Ed,
Now I want to implement the key down event. Means when user clicks on down arrow I want next item to be diplayed and other wise if Up arrow. For this I am using the tv_KeyDown event and changing the item on the arrow clicked either Up or Down. But the problem is for the first click it is moving two nodes istead of one. And from then working fine.
Please let me know your thoughts on this.
Thanks:
Rakesh
|
|
|
|
|
Can you post some code? The only thing I can think of is if the TreeView doesn't have a node selected by default.
|
|
|
|
|
I am explicitly selecting the first node
tv.SelectedNode = tv.Nodes[0];
and here is my code:
private void tv_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyValue == 40) //code for down key only
{
if (currentItemCount > -1 )
{
MyItem[currentItemCount].Visible = false;
tv.Nodes[currentItemCount].BackColor = Color.White;
currentItemCount+= 1;
MyItem[currentItemCount].Visible = true;
if (tv.SelectedNode != null)
{
tv.SelectedImageIndex = tv.Nodes[currentItemCount].ImageIndex;
}
}
}
Rakesh
|
|
|
|
|
Hi all
From where i Get The PASSWORD EXPIRY DATE of user in WINDOWS SERVER 2003 OS
SP
--
Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.
|
|
|
|
|
|
I have an installer.exe. That installer is built in NSIS V2.17. I need to run that installer in silent mode from command line.
My coding is as below:
char regSvrPath1[1024];
strcpy(regSvrPath1, "C:\\Program Files\\Installer.exe");
char regSvrArg1[1024];
strcpy(regSvrArg1, " /S /D=C:\\Program Files\\Installer");
int iI = _spawnl(_P_WAIT, regSvrPath1, regSvrArg1, NULL);
When the spawnl statement is executed, it shows me the messagebox,
"Please specify the installation type as first parameter: /install /upgrade /remove"
I have tried out the arguments as
strcpy(regSvrArg1, " /install /S /D=C:\\Program Files\\Installer");
But it is not working....
Can any one please guide me, how to specify install, uninstall or upgrade option from command line??
|
|
|
|
|
- I do beleive you should run the installer
with a /S for silent mode.
example:
myinstaller.exe /S
-If this has changed with a new version check
your nsis manual
PS: You migh also have to add an IsSilent() check
in your install script
"Shorter of breath,
and one day closer to death." ~Pink Floyd
|
|
|
|
|
i used Mask text box in project
& when i Run Project on diferent pc
if Format of date of system is Different than it give error
that invalid DateTime how i solve this
|
|
|
|
|
How are you accepting data in masked text box? You can convert the input into your format.
For example you can say string.Format("{0:dd\MM\yyyy}",DateTime.Today.Date);
If this does not make any sense, you will have to send me some code of yours
|
|
|
|
|
Hi,
how i can validate a formula.
Formula contains columns of table and operators.
if suppose c1,c2,c3 are columns of table, c1 is of type string, c2 is decimal and c3 is int.
formula may be a+(b*c),or a*(b/c). I need to validate that formula. how i can
approach.if any one had done this plz send me the required code.
lakshmi
|
|
|
|
|
Please clarify what a, b, and c are. Are they c1, c2, and c3, respectively?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
Yes. a,b,c are c1,c2,c3 respectively.
|
|
|
|
|
hi all,
i am using data grid view in my windows application, where in which i have a checkbox for every row it generates
my problem here is i should find out whether the check box is checked or not?
on grid clicked event..
my purpose is i need to select all the row's values of checked checkbox
hope its understood
, please help me
prashanth
|
|
|
|
|
Hi Prashanth,
You can do the following: (case: if using data Binding)
foreach (DataGridViewRow row in dataGridView1.Rows)
{
if ((bool)row.Cells["select"].Value.Equals(true))
{
//Do Something
}
}
In the above case the DataGrid is bound to the following table:
private DataTable Table()
{
DataTable table = new DataTable();
DataColumn col1 = new DataColumn("select",Type.GetType("System.Boolean"));
DataColumn col2 = new DataColumn("Name", Type.GetType("System.String"));
table.Columns.Add(col1);
table.Columns.Add(col2);
DataRow r1 = table.NewRow();
r1["select"] = true;
r1["Name"] = "Something";
DataRow r2 = table.NewRow();
r2["select"] = false;
r2["Name"] = "nothing";
table.Rows.Add(r1);
table.Rows.Add(r2);
return table;
}
Hope that helps.
Cheers
|
|
|
|
|
thnx Mr.RepliCrux
but my question is!
i need to catch whether the checkbox in the grid or checked or not as soon as user checks any checkbox of grid.
hope u got me
please help me
thnx
prashanth
|
|
|
|
|
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
foreach (DataGridViewColumn column in dataGridView1.Columns)
{
if (column.CellType == typeof(DataGridViewCheckBoxCell))
{
//Do Something
MessageBox.Show((string)dataGridView1.Rows[e.RowIndex].Cells[1].Value);
}
}
}
This one will do the trick
|
|
|
|
|
Thanks again Mr.RepliCrux
but for the last statement
e.rowindex.cells[1].value
its giving object reference is not set to instatnce of object exception.
FYI i am using VB.Net does it makes any change/diff here?
prashanth,
s/w Engineer,
Syfnosys.
|
|
|
|
|
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
For Each column As DataGridViewColumn In DataGridView1.Columns
If column.CellType Is GetType(DataGridViewCheckBoxCell) Then
MessageBox.Show(CType(DataGridView1.Rows(e.RowIndex).Cells(1).Value, String))
End If
Next
End Sub
This is how Vb.net code looks, The error you are getting might be because:
1. Your parser is going in that code before your datagrid is initialised.
2. I have said Cells(1) because there is some value in my Cell(1) in that row position. If there
is no Cell(1) in your datagrid you will get that exception
|
|
|
|
|
Thnx for ur reply
but the thing is,
i need to catch the checked state of checkbox of grid.
i mean like a normal checkbox (to which we can catch checked state)
i need to do for grid's check box
hope u got me
FYI i am using VB.Net2.0
thnx in advance
prashanth
|
|
|
|