selectedindex

Getting the SelectedIndex of a child node in a TreeView

痴心易碎 提交于 2019-12-07 18:32:51
问题 I am currently working on a wpf project in C#. I have a treeview created that has parent nodes with childen nodes inside of it. I was wondering if there was a way to get the index of the child node the user clicked on. (Simmilar to ".SelectedIndex" when using comboboxes) I have tried Various ways such as: int val =TreeView.SelectedItemProperty.GlobalIndex; and fileInput.IndexOf(treeView1.SelectedItem); But they dont seem to work. Any suggestions or comments are greatly appreciated. Thanks 回答1

Get selected index tabbar controller Swift

与世无争的帅哥 提交于 2019-12-07 14:06:43
问题 I'm trying to get the selected index of the tabbarController. let application = UIApplication.sharedApplication().delegate as AppDelegate let tabbarController = application.tabBarController as UITabBarController let selectedIndex = tabBarController.selectedIndex I'm getting this error: 'UITabBarController?' does not have a member named 'selectedIndex' Am I missing something? 回答1: application.tabBarController is an optional, this means it can be nil . If you are sure it will never be nil , do

tab bar did select delegate methods give the previously selected tab index in ios, swift 3

风格不统一 提交于 2019-12-07 05:55:21
问题 I'm trying to detect which tab selected by the user, realtime. as an example, if user selecte 0 th index, at the same time I want to get that user has selected the zeroth index tab. so for that , I used tabbarcontroller delegate method like below. override func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) { print("the selected index is : \(selectedIndex)") } but this shows the previous view controller.as an example think I'm in second tab and then I select the first tab then this

Delete Selected File from Listbox and Folder

送分小仙女□ 提交于 2019-12-06 15:59:27
I want to Delete the Selected File from Listbox and Folder. For now it's only removing it from the Listbox. Now I want it to be removed also from the Folder. Thanks private void tDeletebtn_Click(object sender, EventArgs e) { if (listBox1.SelectedIndex != -1) listBox1.Items.RemoveAt(listBox1.SelectedIndex); } private void TeacherForm_Load(object sender, EventArgs e) { DirectoryInfo dinfo = new DirectoryInfo(@"data\\Teachers\\"); FileInfo[] Files = dinfo.GetFiles("*.xml"); foreach (FileInfo file in Files) { listBox1.Items.Add(file.Name); } } If your listBox1.Items contains your filepath, you

Specify a default selected item for HTML form drop-downs

廉价感情. 提交于 2019-12-06 08:52:56
问题 Typically when you need to select an item by default, you do: <select> <option value="1"> Volvo </option> <option value="2" selected="true"> Saab </option> <option value="3"> Mercedes </option> <option value="4"> Audi </option> </select> Is it possible to get something like this? <select selectedValue="2"> <option value="1"> Volvo </option> <option value="2"> Saab </option> <option value="3"> Mercedes </option> <option value="4"> Audi </option> </select> It works out easier in PHP since you

AngularJS Select element set the selected index

你。 提交于 2019-12-06 03:42:59
问题 So i'm using angular and this is my select html: <select id="date" ng-model="selectedDay" ng-change="setDate()" > <option>another option</option> <option>an option</option> </select> this is in my controller: $scope.selectedDay; document.getElementById("date").selectedIndex = "0"; The result: Three options: one blank (which is default selected) and then the two options I made in html What the hell? why isn't the default when i open the view "another option" 回答1: Firstly, always check the

Get selected index tabbar controller Swift

我的未来我决定 提交于 2019-12-06 02:33:23
I'm trying to get the selected index of the tabbarController. let application = UIApplication.sharedApplication().delegate as AppDelegate let tabbarController = application.tabBarController as UITabBarController let selectedIndex = tabBarController.selectedIndex I'm getting this error: 'UITabBarController?' does not have a member named 'selectedIndex' Am I missing something? application.tabBarController is an optional, this means it can be nil . If you are sure it will never be nil , do this: var selectedIndex = tabBarController!.selectedIndex you should try this: let application =

tab bar did select delegate methods give the previously selected tab index in ios, swift 3

一笑奈何 提交于 2019-12-05 12:48:01
I'm trying to detect which tab selected by the user, realtime. as an example, if user selecte 0 th index, at the same time I want to get that user has selected the zeroth index tab. so for that , I used tabbarcontroller delegate method like below. override func tabBar(_ tabBar: UITabBar, didSelect item: UITabBarItem) { print("the selected index is : \(selectedIndex)") } but this shows the previous view controller.as an example think I'm in second tab and then I select the first tab then this prints the index as 2 .so how can I get the correct selected tab. hope your help with this. You can get

Specify a default selected item for HTML form drop-downs

*爱你&永不变心* 提交于 2019-12-04 14:29:40
Typically when you need to select an item by default, you do: <select> <option value="1"> Volvo </option> <option value="2" selected="true"> Saab </option> <option value="3"> Mercedes </option> <option value="4"> Audi </option> </select> Is it possible to get something like this? <select selectedValue="2"> <option value="1"> Volvo </option> <option value="2"> Saab </option> <option value="3"> Mercedes </option> <option value="4"> Audi </option> </select> It works out easier in PHP since you only have to soft-code one value, instead of handling the selected attribute on any possible <option/> .

AngularJS Select element set the selected index

╄→尐↘猪︶ㄣ 提交于 2019-12-04 07:24:35
So i'm using angular and this is my select html: <select id="date" ng-model="selectedDay" ng-change="setDate()" > <option>another option</option> <option>an option</option> </select> this is in my controller: $scope.selectedDay; document.getElementById("date").selectedIndex = "0"; The result: Three options: one blank (which is default selected) and then the two options I made in html What the hell? why isn't the default when i open the view "another option" Nano Firstly, always check the official documentation. AngularJs is well documented. Secondly, do not use document.getElementById ("date")