Format:
Recent snippets matching tags of listbox
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.
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;
167 Views
no comments
var
list: TStringList;
begin
list := TStringList;
try
list.Add( 'Testando' );
ListBox1.Items.Assign( list );
finally
list.free;
end;
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:
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
/// <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
1489 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
