Click here to Skip to main content
15,907,329 members
Home / Discussions / C#
   

C#

 
GeneralRe: Yes Pin
eyeseetee7-Dec-07 5:21
eyeseetee7-Dec-07 5:21 
GeneralRe: Yes Pin
Xmen Real 7-Dec-07 5:54
professional Xmen Real 7-Dec-07 5:54 
GeneralRe: Yes Pin
Guffa7-Dec-07 7:20
Guffa7-Dec-07 7:20 
GeneralHiding a tabsheet Pin
Dewald7-Dec-07 4:38
Dewald7-Dec-07 4:38 
GeneralRe: Hiding a tabsheet Pin
Anthony Mushrow7-Dec-07 6:20
professionalAnthony Mushrow7-Dec-07 6:20 
GeneralSetting focus on new DeckItem [modified] Pin
oracleConvert7-Dec-07 4:24
oracleConvert7-Dec-07 4:24 
GeneralRe: Setting focus on new DeckItem Pin
Skippums7-Dec-07 5:14
Skippums7-Dec-07 5:14 
GeneralRe: Setting focus on new DeckItem Pin
oracleConvert7-Dec-07 5:51
oracleConvert7-Dec-07 5:51 
No, I do not have the focus in the constructor, it is in the method we call to show the textbox, select the text.

Here is the code where I create the deckItem:

DeckItem item = CreateDeckPage(statLibDO);
statLibDO.Order = this.View.ControlDeck.Count;
this.View.ControlDeck.Add(item);
this.View.ControlDeck.SelectedItem = item;

EnableEditMode(this.currentDeckItem.DeckHeader as ReportTreeViewHeader);

Here is the EnableEditMode method:

private static void EnableEditMode(ReportTreeViewHeader header)
{
if (header != null)
{
header.EditHeaderText();
if (!header.HeaderEditor.IsFocused)
header.HeaderEditor.Focus();

}
}

Finally, here is the code for header.EditHeaderText that does all the work:
public void EditHeaderText()
{
//this.headerEditor.Text = this.headerText.Content.ToString();
this.headerText.Visibility = Visibility.Hidden;
this.headerEditor.Visibility = Visibility.Visible;

this.headerEditor.SelectAll();
this.headerEditor.Focus();
ReportDragDropManager.SuspendDragDropActivity = true;

}

Also, here is the code when the want to rename an existing deckItem whick works fine:
private void MenuItem_ClickRename(object sender, RoutedEventArgs e)
{
if (this.targetDeckItem != null)
EnableEditMode(this.targetDeckItem.DeckHeader as ReportTreeViewHeader);
else if (this.targetTreeViewItem != null)
EnableEditMode(this.targetTreeViewItem.ReportTreeViewItemHeader);

}

This calls the same EnableEditMode method that gets called when I create a new deckitme. The problem seems to me that the new deck item is not yet loaded (IsLoaded is false) so I am thinking that is why I can not get focus on the deck. How do I get the new deckItem loaded?

Thanks for your reply!
GeneralRe: Setting focus on new DeckItem Pin
Skippums7-Dec-07 6:13
Skippums7-Dec-07 6:13 
GeneralRe: Setting focus on new DeckItem Pin
oracleConvert7-Dec-07 6:21
oracleConvert7-Dec-07 6:21 
GeneralRe: Setting focus on new DeckItem Pin
Skippums7-Dec-07 9:18
Skippums7-Dec-07 9:18 
GeneralRe: Setting focus on new DeckItem Pin
oracleConvert7-Dec-07 9:44
oracleConvert7-Dec-07 9:44 
GeneralRe: Setting focus on new DeckItem Pin
Skippums10-Dec-07 3:52
Skippums10-Dec-07 3:52 
GeneralRe: Setting focus on new DeckItem Pin
oracleConvert10-Dec-07 4:57
oracleConvert10-Dec-07 4:57 
GeneralGet Data From OLEDBDataReader Pin
tr_thorn7-Dec-07 3:34
tr_thorn7-Dec-07 3:34 
GeneralRe: Get Data From OLEDBDataReader Pin
Pete O'Hanlon7-Dec-07 3:48
mvePete O'Hanlon7-Dec-07 3:48 
GeneralRe: Get Data From OLEDBDataReader Pin
pmarfleet7-Dec-07 3:49
pmarfleet7-Dec-07 3:49 
GeneralRe: Get Data From OLEDBDataReader Pin
Dr. Emmett Brown7-Dec-07 3:57
Dr. Emmett Brown7-Dec-07 3:57 
GeneralRe: Get Data From OLEDBDataReader Pin
tr_thorn8-Dec-07 2:53
tr_thorn8-Dec-07 2:53 
Questionhow to use "bgcolor"? Pin
Imran Adam7-Dec-07 3:24
Imran Adam7-Dec-07 3:24 
AnswerRe: how to use "bgcolor"? Pin
Ennis Ray Lynch, Jr.7-Dec-07 3:27
Ennis Ray Lynch, Jr.7-Dec-07 3:27 
GeneralRe: how to use "bgcolor"? Pin
Imran Adam7-Dec-07 3:30
Imran Adam7-Dec-07 3:30 
GeneralRe: how to use "bgcolor"? Pin
Pete O'Hanlon7-Dec-07 3:46
mvePete O'Hanlon7-Dec-07 3:46 
GeneralRe: how to use "bgcolor"? Pin
Imran Adam7-Dec-07 8:28
Imran Adam7-Dec-07 8:28 
AnswerRe: how to use "bgcolor"? Pin
Skippums7-Dec-07 3:53
Skippums7-Dec-07 3:53 

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.