CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of listbox
C#
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Interactivity;
using System.Windows.Threading;
 
namespace Behaviors
{
    /// <summary>
    /// On ListBoxes using CanContentScroll=True (virtualized), WPF layout changes will make the scrollviewer reset to zero.
by SandRock   October 26, 2011 @ 12:01am
42 Views
no comments
 
// cria uma string com n caracteres
function IncStr( Str: String; Qtd: Integer ): String;
var v_Str: String;
begin
  v_Str := Str;
  While Length( SysUtils.Trim( Str ) ) < Qtd do
    Str := v_Str+ SysUtils.Trim(Str);
  // Retorno da Funcao.
  Result := Str;
end;
by Thiago Pedro   October 18, 2010 @ 6:56pm
167 Views
no comments
 
var
  list: TStringList;
begin
  list := TStringList;
  try
    list.Add( 'Testando' );
    ListBox1.Items.Assign( list );
  finally
    list.free;
  end;
by Thiago Pedro   September 02, 2010 @ 4:05pm
204 Views
no comments
 
Como faço para listar os tipos enumerados de força mais fácil e dinâmica num ComboBox?
 
Essa foi a pergunta de uma grande amigo meu hoje. Confesso que não tinha muita idéia de como fazer. Imagine a situação:
 
type
TMeuTipo = (Tipo1, Tipo2, Tipo3, Tipo4, Tipo5);
 
Como fazer isso aparecer em um ComboBox?
Bem, podemos transformar isso em Strings e então adicioná-lo ao Combo, mais ou menos assim:
by Adriano Santos   August 27, 2010 @ 12:02pm
287 Views
no comments
 
// ===================================================================
// Author: Matt Kruse <matt@mattkruse.com>
// WWW: http://www.mattkruse.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
330 Views
no comments
 
C#
/// <summary>
        /// Sorts the list box in descending order
        /// </summary>
        /// <param name="pList">the list to sort</param>
        /// <param name="pByValue">Sort the list by values or text</param> 
        private void SortListBox(ref ListBox pList, bool pByValue)
        {
            var lListItems = new System.Collections.SortedList();
 
            //add listbox items to SortedList 
by Abhilash   November 13, 2009 @ 4:03am
1489 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate