Click here to Skip to main content
15,889,176 members
Home / Discussions / C#
   

C#

 
GeneralRe: Store value in application instead of database Pin
Christian Graus22-Jan-07 19:43
protectorChristian Graus22-Jan-07 19:43 
GeneralRe: Store value in application instead of database Pin
cocoonwls22-Jan-07 20:00
cocoonwls22-Jan-07 20:00 
GeneralRe: Store value in application instead of database Pin
Christian Graus22-Jan-07 20:03
protectorChristian Graus22-Jan-07 20:03 
GeneralRe: Store value in application instead of database [modified] Pin
bobsugar22222-Jan-07 22:09
bobsugar22222-Jan-07 22:09 
AnswerRe: Store value in application instead of database Pin
aSarafian23-Jan-07 1:05
aSarafian23-Jan-07 1:05 
Questionnewbie: How to implent Back button on Treeview selections Pin
Monika Dotnet Newbie22-Jan-07 17:55
Monika Dotnet Newbie22-Jan-07 17:55 
AnswerRe: newbie: How to implent Back button on Treeview selections Pin
Parwej Ahamad22-Jan-07 18:18
professionalParwej Ahamad22-Jan-07 18:18 
AnswerRe: newbie: How to implent Back button on Treeview selections Pin
Mircea Puiu22-Jan-07 21:39
Mircea Puiu22-Jan-07 21:39 
Do something like this:
1) Make sure you are using System.Collections;
2) Declare ArrayList history; in your Form derived class (let it be Form1), and treeView1 your TrieView control;
3) Initialize history in Form1_Load(object sender, EventArgs e):
history = new ArrayList();
4) In the private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) handler, write this piece of code:
TreeNode tn = treeView1.SelectedNode;<br />
if (tn != null) history.Add(tn);

5) In the private void YourGoBackButton_Click(object sender, EventArgs e), write this piece of code:
if (history.Count < 2) return;<br />
// Unregister the AfterEselect event<br />
treeView1.AfterSelect -= new System.Windows.Forms.TreeViewEventHandler(treeView1_AfterSelect);<br />
// Get the previously selected node<br />
TreeNode tn = (TreeNode)history[history.Count - 2];<br />
// Remove the last selected node from the history<br />
history.RemoveAt(history.Count - 1);<br />
// Select the node and expand it<br />
treeView1.SelectedNode = tn;<br />
while (tn != null)<br />
{<br />
   tn.Expand();<br />
   tn = tn.Parent;<br />
}<br />
// Re-register the AfterSelect event<br />
treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(treeView1_AfterSelect);<br />
// Set the focus to the TreeView<br />
treeView1.Focus();<br />

Enjoy!

SkyWalker

GeneralRe: newbie: How to implent Back button on Treeview selections Pin
bobsugar22223-Jan-07 3:41
bobsugar22223-Jan-07 3:41 
Questiondatabase updation Pin
raju_net181822-Jan-07 17:14
raju_net181822-Jan-07 17:14 
AnswerRe: database updation Pin
Christian Graus22-Jan-07 17:25
protectorChristian Graus22-Jan-07 17:25 
GeneralRe: database updation Pin
raju_net181822-Jan-07 17:33
raju_net181822-Jan-07 17:33 
GeneralRe: database updation Pin
Christian Graus22-Jan-07 17:37
protectorChristian Graus22-Jan-07 17:37 
GeneralRe: database updation Pin
raju_net181822-Jan-07 17:42
raju_net181822-Jan-07 17:42 
GeneralRe: database updation Pin
raju_net181822-Jan-07 21:46
raju_net181822-Jan-07 21:46 
Questiongetting a dataset of affected records,using an ExecuteNONQuery OleDbCommand Pin
dsovino22-Jan-07 15:23
dsovino22-Jan-07 15:23 
AnswerRe: getting a dataset of affected records,using an ExecuteNONQuery OleDbCommand Pin
Guffa22-Jan-07 19:30
Guffa22-Jan-07 19:30 
GeneralRe: getting a dataset of affected records,using an ExecuteNONQuery OleDbCommand Pin
aSarafian23-Jan-07 1:06
aSarafian23-Jan-07 1:06 
AnswerRe: getting a dataset of affected records,using an ExecuteNONQuery OleDbCommand Pin
Guffa23-Jan-07 5:36
Guffa23-Jan-07 5:36 
GeneralRe: getting a dataset of affected records,using an ExecuteNONQuery OleDbCommand Pin
aSarafian23-Jan-07 7:51
aSarafian23-Jan-07 7:51 
GeneralRe: getting a dataset of affected records,using an ExecuteNONQuery OleDbCommand Pin
Guffa23-Jan-07 12:23
Guffa23-Jan-07 12:23 
QuestionRe: getting a dataset of affected records,using an ExecuteNONQuery OleDbCommand Pin
dsovino23-Jan-07 4:14
dsovino23-Jan-07 4:14 
AnswerRe: getting a dataset of affected records,using an ExecuteNONQuery OleDbCommand Pin
Guffa23-Jan-07 5:42
Guffa23-Jan-07 5:42 
QuestionPass parameter in MouseEventHandler Pin
cocoonwls22-Jan-07 15:16
cocoonwls22-Jan-07 15:16 
AnswerRe: Pass parameter in MouseEventHandler Pin
Luc Pattyn22-Jan-07 15:32
sitebuilderLuc Pattyn22-Jan-07 15:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.