|
Hey
I am using a TreeView to show some objects.
When a object is updated from the network connection the tree is updated(re build)
If the user hade open/expand some nodes it will be closed after the rebuild is runned.
Is there any way to save what nodes that is expand and what item that is selected?
Best Regards
Snowjim
|
|
|
|
|
Snowjim wrote:
Is there any way to save what nodes that is expand
Use the Expanded property of TreeNode .
Snowjim wrote:
and what item that is selected?
Use TreeView.SelectedNode or TreeNode.IsSelected .
Charlie
if(!curlies){ return; }
|
|
|
|
|
The easiest way (but not most efficient) is to recursively go through the tree and check (like Charlie mentioned) the Expanded property of each node. For each node you find where this property is true add the FullPath of the node to an ArrayList. After youve updated the tree, again search recursively through the tree and expand each node where its FullPath is contained in the ArrayList.
Same goes for the selected item. Remember the FullPath value of the currently selected item and reset it after your update.
|
|
|
|
|
I have a list box control on a win form. Whenever another control on the same form (eg another list box) chnages selection my first list box maintains it's selected item but moves it's scroll position so that the selected item appears at the bottom of the visible list. Does anyone know how I can stop this from happening?
|
|
|
|
|
if I have two form, form1 has a progress bar and form2 has a method Cal(). I want to call method Cal() for activate progress bar in form1. Please show me a simple code i'm a newbie in C#. Thank you
|
|
|
|
|
where can i get GPRS emulator for mobile devices???? sum1 plz help me ???
|
|
|
|
|
|
Hi I am reposting the following message in case anyone can help,
I am creating a generic data access module for an application and I
have come across the following problem:
A form calls the function that loads data from a table to a grid. Then
the code below is called in order to effect any changes in the dataset.
The problem appears with a table that has 43 columns. When in the
selectCommand I pass a select statement containing up to 32 columns it
works without problems. When I increase the number of columns it gives
a "Concurrency violation: the UpdateCommand affected 0 records."
exception. Is this some because of some limitation or am I making an
error in the code?
The table contains 4555 records
public void SaveDataFromGrid(DataSet dsName, string dtName, string
selectCommand)
{
//DGM 20040109
//This code works only for single table updates.
//Create new Connection
OdbcConnection dbConnection = new OdbcConnection(strConnectionString);
//Set the sql command that will fill the dataset
OdbcCommand sqlCommand = new OdbcCommand(selectCommand, dbConnection);
sqlCommand.CommandTimeout = 30;
//Set the sql command that will update the dataset
//Set the data adapter
OdbcDataAdapter dbDataAdapter = new OdbcDataAdapter();
OdbcCommandBuilder cb = new OdbcCommandBuilder(dbDataAdapter);
dbDataAdapter.SelectCommand = sqlCommand;
//Open the connection
dbConnection.Open();
//Fill the dataset with the data
dbDataAdapter.Update(dsName, dtName);
//Close the database connection
dbConnection.Close();
//return true;
}
Thanks in advance for the help
|
|
|
|
|
Hi,I have a UserControl that contains a Panel in it.
I add the UserControl to a Form.
I want (at design time) to be able to add, remove, move ,etc, controls on the Panel contained in my UserControl in the same way i would do this if the Panel was placed directly on a Form.Any Ideas?
Thanks!
|
|
|
|
|
try to make a pblic property to the panel
like:::
pblic Panel MyPanel
{
get{return this.panel1;}
set{this.panel1 = value;}
}
ByMindOnlyYouCanDoIt
|
|
|
|
|
Hi all,
Does anyone how can I creat a mapfile for my c# project?
For c++ project it's very easy.
You can do it from Project Settings,
just need to set generation of mapfile in Link Tab.
How can I do the same for c#?
Thanks in advance,
Anna.
|
|
|
|
|
|
|
I have a problem i was hoping someone could help me.
I have a windows form and based on a menu selection i'll display a specific user control uc1 that has various information on it (like a calender with appts on it) when i press down on the mouse I want to present another user control uc2 (this is a custom drawn via gdi+) at a specific location. I set the uc2.Location as to where I want uc2 to appear. This is where my problem occurs. Wherever i press the mouse on uc1 it uc2 always appears at a location just above and left of the mouse based on the location where i press the mouse on uc1. also note when i press the mouse down uc2 initially briefy appears where i want it but than moves/appears just above and left of the mouse. I also dispose of uc2 when the mouseup event fires.
i also use the mousedown event to move uc2. this works fine (but with the location problem) and uc2 moves fine but starts from the location just above and left of the mouse not where i had set the position via uc2.Location.
note i also use uc2.visible=true and uc2.BringToFront()
Does anybody have any ideas?
As always - thanks in advance for your help
Bob d.
|
|
|
|
|
hi i want to make a program that will read the inbox of the outlook 2003 and then save the inbox mail messages as *.msg format so can any one help me to get this code
Thanks alot
Hamody
|
|
|
|
|
Look at Internet part in C# section in this site , there are some articles about how to get emails from your mailbox.
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
hi sorry but could u plz clear whart u mean plz dnt get nervous from me :->
Thanks alot
Hamody
|
|
|
|
|
|
hi there, i tried the path u sent me and i looked in it for what i look for but there still a problem in saving the email as *.msg format
i made a form that i can check the inbox thrugh it i want to save the emails that i choose as *.msg could u plz help me
Thanks alot
Hamody
|
|
|
|
|
hello
i wonder how i can embed fonts in my assembly and use them without installing them on each computer ?
regards.
|
|
|
|
|
|
Hi all!!!
i'm quite bored with a problem I can't solve.
I'm doing a program which imitates the mouse, and I need that when I do "click" (double click or whatever) in another application, although the latter is actived now, I want my window to still keep the keyboard input to can handle it.
I have try with SetFocus() and GetFocus() from Windows API but I can't make it works.
If you could help me,it would be great;)
Thanks,
ciao!
|
|
|
|
|
|
Thanks Mazdak...
I was just working with hooks now, and I succeded getting all the keyboard input. But then I have a new problem which seems easier but I cannot solve.
In a form with some controls (all of them buttons) how can I know wich button is selected? I'm trying with the focused and containsfocus property but it's not working.
And the last thing... in case I could know which control is selected, how could I generate the click event of this button without actually "click" it?..
Thanks;)
|
|
|
|
|
Not sure but you can look through:
BegoBergua wrote:
In a form with some controls (all of them buttons) how can I know wich button is selected? I'm trying with the focused and containsfocus property but it's not working.
GetFocus() or GetGUIThreadInfo() API
BegoBergua wrote:
in case I could know which control is selected, how could I generate the click event of this button without actually "click" it?..
Look for SendMessage() API. I remember that there are some samples in CP. Use search textbox at the top of the page.
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|