.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Reverse Superscript for Listbox Items in C# windows

Posted By:      Posted Date: September 16, 2010    Points: 0   Category :Windows Application
I want to show Reverse Super script formate for Listbox Items when i check CheckBox using c# windows forms. thanks ram

View Complete Post

More Related Resource Links

Move items from one listbox to another listbox in C# windows application.


Hi, I have two listbox controls. I have to move the selected items from first list box to second list box and vice versa. Also i have to move all the items from listbox1 to listbox2 and vice versa. . The listbox box is already assigned the datasource property. The datasource for both list box is dataset. Please help in solving this issue.


Thanks in advance


How to create a dynamically populated items in a listbox and use it as a navigation?

Hello, I am trying to create navigation inside a listbox menu. I load data from xml to populate a list. Each item in the list box should be a link or button. Then, I create a frame to load xaml pages in it. I tested to load pages employing button control, outside listbox with on click event and it worked well. However, I cannot make it work with list box items. I am hoping to get help from you. Any sample or ideas are highly appreciated. Below is the code:  XML: <?xml version="1.0" encoding="utf-8"?> <Pages> <page id="page01"> <name>Page 01</name> </page> <page id="page02"> <name>Page 02</name> </page> </Pages> C# to initiate a click o n listbox item and get the path to page: private void SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e) { ListBoxItem lbi = ((sender as ListBox).SelectedItem as ListBoxItem); string itemName = lbi.Content.ToString(); if ( Nav_ListBox.SelectedItem.Equals("Page01" ) ) { ContentFrame.Source = new Uri("Pages/Page01.xaml", UriKind.RelativeOrAbsolute); } } XAML:  <ListBox x:Name="Nav_ListBox" Margin="0" ScrollViewer.HorizontalScrollBarVisibility="Hidden" Background="#FFF2F2F2" ItemTemplate="{DynamicReso

Animate listbox items from ItemTemplate

I want to have a slide-in effect for listbox items, when it's first loaded. I'm using ItemTemplate for listbox items and I coule do the slide-in effect from within the template using RenderTransform and DocubleAnimation. but as the Listbox is vertualized, it does the effect everytime new page of data is loaded in listbox. What I want is to animate the visible items in listbox only when DataContext is changed the first time, like messages list in 'Windows Live Mail' thanks in advance.  

Selecting Items in a databound ListBox

Hi All, I'm facing a problem while trying to programatically preselect few items in a databound ListBox. I have set the datasource of the listbox to a DataTable, with required Data and Value member columns. The selection mode of the listbox is MULTIEXTENDED. Platform: .NET  1.1 (not sure if the problem is relevant to other versions) I tried preselecting items in a different ListBox that is not bound to any datasource. I'm able to preselect items using the SetSelected method. Perfect!   How can I achieve the same for a databound ListBox? What am I missing? Any help will be very much appreciated.   Regards, Amirtha

How to get values setted in custom items from a ListBox




I have a ListBox which looks like that :

Its DataTemplat is :


<DataTemplate x:Key="IndexDataTemplate">
   <StackPanel Margin="0,0,0,5">
    <TextBlock Height="Auto"

Problem when adding items to a listbox from different threads


I have an application in which different threads add items to a listbox throughout the application's execution (not at startup). But when one of the threads tries to add an item to the listbox, a System.InvanlidOperationException is thrown and the error message is: "The calling thread cannot access this object because a different thread owns it." (In my scenario the "calling thread" is one of the worker threads that add items to the listbox, and the "different thread" is the UI thread.)

So basically I just need a simple way to allow the threads to share the listbox object, or, failing that, some other workaround.

Windows Application reverse engineering is possible?



Long time back, i've developed a windows application using .NET v2.0 or 3.5, am not sure of the version. And i deleted the source as this application is not making any meaning to me. But fortunately, when i gave this application to one of my friend to test within his environment and he found that application as very useful for him. But he never expressed his gratitude to me.

Now that the application needs a new feature, he came back to me with the .EXE file and asked me to make some modificaitons. As i dont have the source for this, is there any possiblitiy to perform the reverse engineering on this Windows EXE and get the source?

Thanks for reading

Every thing is perfect as long as you share

Adding Items to ListBox with animation



I have the following code:

<DataTemplate x:Key="DataTemplate1">
		<EventTrigger RoutedEvent="FrameworkElement.Loaded" SourceName="textBlock">

System.Windows.Forms.ListBox scroll-to-top on focus - how can I prevent this behavior?




I've been trying to find a solution online for the last couple days and I'm surprised at how little there is on this topic -- namely, I'm trying to prevent the default behavior of ListBoxes scrolling to the top whenever they regain focus.


I've created a toolbar-like control that is docked on the left-hand side of my screen.  This vertical toolbar is comprised of several ListBoxes, and each ListBox is collapsible (much like the Visual Studio designer toolbar).  The problem is, if I click on an item on a ListBox that is partially off the top of the screen, the entire toolbar scrolls so that the first item in that particular ListBox is at the top, so your mouse is no longer over the item you originally wished to select.


I'm trying to figure out a way to prevent this behavior.  Any suggestions?



Coloring DropDown ListBox Items


I have a situation where some dropdown listboxes contain some items, then there's a separator line, and then there are more items.  The ones above the separator line reflect the "commonly used items".  To better highlight these I was using code like this to individually color those specfic items:

         foreach (ListItem item in ddList.Items)
          if (item.Value == "-1")
            unAssigned = true;

          if (!unAssigned)
            item.Attributes.Add("style", "color:#5558ff");

This code works fine EXCEPT that once a PostBack occurs then the highlighting disappears.  The items in the dropdown listbox remain (without repopulation) but not the highlighting.

I'm curious why this is happening and whether there's a way for the highlighting to "stick" short of calling this code from the Page_Load event handler every Postback?


WPF ListBox doesn't Group items if I don't use ItemSource.


WPF ListBox doesn't Group items if I don't use ItemSource.

This code snippet works but I use



private ObservableCollection<

Adding windows forms controls to the display of list items



I'm new to Sharepoint development, and was wondering if I could get some brief pointers to get me going in the right direction.  I'm required to add a button to list items that on submit does some manipulation of the data in the fields inside the item and then sends that data off to an external webservice.  The complexity is sufficient to warrant managed code, i.e. C#.

What I'd like to know is how to approach integrating this code into Sharepoint.  I've read about web parts, but viewing list items doesn't involve web part pages on my installation so I can't include my own.  What other ways are there of doing this?

Cheers all

System.Windows.Data Error: 26 : ItemTemplate and ItemTemplateSelector are ignored for items already



I have a problem with ItemTemplates:

< ItemsControl ItemsSource = " {Binding ViewList} " >
< ItemsControl .ItemTemplate >
< DataTemplate >
< GroupBox >
< ContentControl Content = " {Binding} " />
</ GroupBox >
</ DataTemplate >

How to unselect selected items in Listbox after SelectedIndexChanged


Hello i have a listbox LbGeneratedExcelLinks  when i click inside of it on an item it download the selected item

here s my code

Protected Sub LbGeneratedExcelLinks_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles LbGeneratedExcelLinks.SelectedIndexChanged
        Dim RedirectUrl As String = LbGeneratedExcelLinks.SelectedValue
        LbGeneratedExcelLinks.SelectedIndex = Nothing
    End Sub

problem is if i want to click on another button or other event it keeps showing the dialog open or save file the one i put inside selectedindexChanged

 i need help to unselect after the selectedindexchanged i think it will solve my problem

Listbox hyperlink items


Hello , i want to create a dynamic listbox where items are links (each item is a hyperlink)

here 's my code

Using sw As StreamWriter = New StreamWriter(Server.MapPath("~/Output/" & weeknumber & ".xls"))
                    Dim hlk As New HyperLink
                    hlk.NavigateUrl = ("~/Output/" & weeknumber & ".xls")

                    Using hw As HtmlTextWriter = New HtmlTextWriter(sw)

Extending a ListBox Control - How to make the extended type require the listbox items implement a ch


I am working on a drag and droppable timeline control, and I am making decent progress.  What I have so far will work decently enough with MVVM design patterns, but I am inexperienced with this kind of advanced control extending so I am sure that some of my methods are crude at best.

I have an extended content presenter control that I want to ensure is what is actually used inside my specialized listbox.  Right now I do the following:

<DataTemplate x:Key="TempTemplate" DataType="{x:Type local:TempDataType}">

			<tt:TimeLineItemControl StartTime="{Binding Path=StartTime}
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend