Foros del Web » Programación para mayores de 30 ;) » .NET »

Ayuda con filtro combobox

Estas en el tema de Ayuda con filtro combobox en el foro de .NET en Foros del Web. Necesito alguien que me ayude con mis combobox para que se pueda hacer un filtro con otro mis datos son los siguientes version de visual ...
  #1 (permalink)  
Antiguo 03/11/2008, 07:15
Avatar de Reyscorpion  
Fecha de Ingreso: octubre-2008
Mensajes: 74
Antigüedad: 15 años, 6 meses
Puntos: 0
Ayuda con filtro combobox

Necesito alguien que me ayude con mis combobox para que se pueda hacer un filtro con otro mis datos son los siguientes

version de visual Studio.net 2008

este es el combobox 1 que se llama cmblin

this.cmblin.Items.Add("Acabados");
this.cmblin.Items.Add("Adhesivos");
this.cmblin.Items.Add("Bob-Grande");
this.cmblin.Items.Add("Bob-Chica");
this.cmblin.Items.Add("Brodbeck");
this.cmblin.Items.Add("C-65");
this.cmblin.Items.Add("E-2");
this.cmblin.Items.Add("E-17");
this.cmblin.Items.Add("E-43");
this.cmblin.Items.Add("E-48");
this.cmblin.Items.Add("Embarques");
this.cmblin.Items.Add("Flejadora-1");
this.cmblin.Items.Add("Flejadora-2");
this.cmblin.Items.Add("Impresora-1");
this.cmblin.Items.Add("Impresora-2");
this.cmblin.Items.Add("IPD");
this.cmblin.Items.Add("J-1");
this.cmblin.Items.Add("J-2");
this.cmblin.Items.Add("J-3");
this.cmblin.Items.Add("L-1");
this.cmblin.Items.Add("L-2");
this.cmblin.Items.Add("L-3");
this.cmblin.Items.Add("Lhomme");
this.cmblin.Items.Add("Manufacturas");
this.cmblin.Items.Add("Paco-1");
this.cmblin.Items.Add("Paco-2");
this.cmblin.Items.Add("Shelfton");
this.cmblin.Items.Add("Tureti");

y este es el segundo combobox que se llama cmdequ

this.cmbequ.Items.Add("Creel");
this.cmbequ.Items.Add("Adhesivos");
this.cmbequ.Items.Add("Conveyor");
this.cmbequ.Items.Add("Tina dextrina");
this.cmbequ.Items.Add("Sierra");
this.cmbequ.Items.Add("Mandril");
this.cmbequ.Items.Add("Groover-1");
this.cmbequ.Items.Add("Groover-2");
this.cmbequ.Items.Add("Groover-3");

lo que quiero es que cuando escoja por ejemplo en el cmblin acabados en el segundo combobox solo me aparezca creel, adhesivos y conveyor y no todo lo que contiene el segundo combobox, espero me puedan ayudar gracias
  #2 (permalink)  
Antiguo 03/11/2008, 12:45
Avatar de agressor  
Fecha de Ingreso: noviembre-2007
Ubicación: Knocking the Death Door..
Mensajes: 368
Antigüedad: 16 años, 5 meses
Puntos: 3
Respuesta: Ayuda con filtro combobox

Lo que puedes hacer es que en el evento ON Selected Index Changed llenes el cmdequ con los valores que necesites.. dependiendo claro de la seleccion de cmblin.!

Salu2..!!
__________________
Somos lo que nosotros queremos ni mas ni menos..
No hay dia mas perdido que aquel en que no hemos reido..
La vida es tal y como debe ser...
Nadie vivira por ti...

Última edición por agressor; 03/11/2008 a las 12:46 Razón: Falta especificacion
  #3 (permalink)  
Antiguo 04/11/2008, 11:02
Avatar de Reyscorpion  
Fecha de Ingreso: octubre-2008
Mensajes: 74
Antigüedad: 15 años, 6 meses
Puntos: 0
Respuesta: Ayuda con filtro combobox

Hola agressor
Se me hizo interesante lo que me comentas aunque si se soluciona un poco el problema pero queda mi duda, ahora como hago que si selecciono por ejemplo de cmblin "Acabados" en el otro combobox solo me aparezcan mis tres opciones que serian "sierra", "Mandril" y "Tina dextrina", espero que haya sido claro y me puedas hechar la mano ya seas tu o cualquier otro
  #4 (permalink)  
Antiguo 04/11/2008, 11:14
Avatar de agressor  
Fecha de Ingreso: noviembre-2007
Ubicación: Knocking the Death Door..
Mensajes: 368
Antigüedad: 16 años, 5 meses
Puntos: 3
Respuesta: Ayuda con filtro combobox

Lo haces con un SelectCase dando como referencia el Index del Combobox dando de esta manera..

' Get the currently selected item in the ListBox.
Dim curItem As String = listBox1.SelectedItem.ToString()

' Find the string in ListBox2.
Dim index As Integer = listBox2.FindString(curItem)
' If the item was not found in ListBox 2 display a message box, otherwise select it in ListBox2.
If index = -1 Then
MessageBox.Show("Item is not available in ListBox2")
Else
SelectCase(curitem)
Case '1'
this.cmbequ.Items.Add("Sierra");
this.cmbequ.Items.Add("Mandril");
this.cmbequ.Items.Add("Tina dextrina");
Case '2'
' Llenacmbeque con las opciones que quieras
End Select
End If

Lo unico es que necesitas saber cual Index es la opcion que seleccionas digamos si Acabados es la opcion 0 (osea la primera opcion del select si es la segunda es 1 y asi sucesivamente..)te llenara cmbequ con las opciones que coloques..

Espero me entiendas..

Prueba y me cuentas.. este ejemplo no lo he probado solo te lo coloco para que mas o menos te des una idea..

Salu2.!!
__________________
Somos lo que nosotros queremos ni mas ni menos..
No hay dia mas perdido que aquel en que no hemos reido..
La vida es tal y como debe ser...
Nadie vivira por ti...
  #5 (permalink)  
Antiguo 04/11/2008, 11:27
Avatar de Reyscorpion  
Fecha de Ingreso: octubre-2008
Mensajes: 74
Antigüedad: 15 años, 6 meses
Puntos: 0
Respuesta: Ayuda con filtro combobox

Disculpa que te este molestando pero la verdad es que soy nuevo con el c# y es muy poco lo que entiendo aunque haber esto donde lo pongo? porque no entiendo muy bien lo que me comentas lo he metido pero me marca errores si quieres aqui te dejo como lo tengo y haber si me puedes ayudar vale? digo espero y no te moleste mi ignorancia, gracias....

System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication5
{
public partial class Form1 : Form
{

public Form1()
{
InitializeComponent();
}

private void label3_Click(object sender, EventArgs e)
{

}

private void label4_Click(object sender, EventArgs e)
{

}

private void label8_Click(object sender, EventArgs e)
{

}

private void comboBox8_SelectedIndexChanged(object sender, EventArgs e)
{
this.cmbtie.Enabled = true;
this.cmbherr.Enabled = true;

}

private void comboBox3_SelectedIndexChanged(object sender, EventArgs e)
{
this.cmbrep.Enabled = true;
this.cmbent.Enabled = true;
}

private void Form1_Load(object sender, EventArgs e)
{
this.cmblin.Items.Add("Acabados");
this.cmblin.Items.Add("Adhesivos");
this.cmblin.Items.Add("Bob-Grande");
this.cmblin.Items.Add("Bob-Chica");
this.cmblin.Items.Add("Brodbeck");
this.cmblin.Items.Add("C-65");
this.cmblin.Items.Add("E-2");
this.cmblin.Items.Add("E-17");
this.cmblin.Items.Add("E-43");
this.cmblin.Items.Add("E-48");
this.cmblin.Items.Add("Embarques");
this.cmblin.Items.Add("Flejadora-1");
this.cmblin.Items.Add("Flejadora-2");
this.cmblin.Items.Add("Impresora-1");
this.cmblin.Items.Add("Impresora-2");
this.cmblin.Items.Add("IPD");
this.cmblin.Items.Add("J-1");
this.cmblin.Items.Add("J-2");
this.cmblin.Items.Add("J-3");
this.cmblin.Items.Add("L-1");
this.cmblin.Items.Add("L-2");
this.cmblin.Items.Add("L-3");
this.cmblin.Items.Add("Lhomme");
this.cmblin.Items.Add("Manufacturas");
this.cmblin.Items.Add("Paco-1");
this.cmblin.Items.Add("Paco-2");
this.cmblin.Items.Add("Shelfton");
this.cmblin.Items.Add("Tureti");
this.cmbequ.Items.Add("Creel");
this.cmbequ.Items.Add("Adhesivos");
this.cmbequ.Items.Add("Conveyor");
this.cmbequ.Items.Add("Tina dextrina");
this.cmbequ.Items.Add("Sierra");
this.cmbequ.Items.Add("Mandril");
this.cmbequ.Items.Add("Groover-1");
this.cmbequ.Items.Add("Groover-2");
this.cmbequ.Items.Add("Groover-3");
this.cmbtie.Items.Add("0");
this.cmbtie.Items.Add("5");
this.cmbtie.Items.Add("10");
this.cmbherr.Items.Add("0");
this.cmbherr.Items.Add("10");
this.cmbrep.Items.Add("0");
this.cmbrep.Items.Add("15");
this.cmbrep.Items.Add("30");
this.cmbent.Items.Add("0");
this.cmbent.Items.Add("10");
this.cmblim.Items.Add("0");
this.cmblim.Items.Add("10");
this.cmbhrs.Items.Add("0");
this.cmbhrs.Items.Add("30");
this.cmbmcp.Items.Add("MC");
this.cmbmcp.Items.Add("MP");
this.cmbmes.Items.Add("Enero");
this.cmbmes.Items.Add("Febrero");
this.cmbmes.Items.Add("Marzo");
this.cmbmes.Items.Add("Abril");
this.cmbmes.Items.Add("Mayo");
this.cmbmes.Items.Add("Junio");
this.cmbmes.Items.Add("Julio");
this.cmbmes.Items.Add("Agosto");
this.cmbmes.Items.Add("Septiembre");
this.cmbmes.Items.Add("Ooctubre");
this.cmbmes.Items.Add("Noviembre");
this.cmbmes.Items.Add("Diciembre");
this.cmbtur.Items.Add("1º");
this.cmbtur.Items.Add("2º");
this.cmbtur.Items.Add("3º");
this.cmbmec.Items.Add("Adalberto R.");
this.cmbmec.Items.Add("Diego O.");
this.cmbmec.Items.Add("German G.");
this.cmbmec.Items.Add("Gilberto R.");
this.cmbmec.Items.Add("José B.");
this.cmbmec.Items.Add("Marcelino H.");
this.cmbmec.Items.Add("Moises L.");
this.cmbmec.Items.Add("Raúl A.");
this.cmbmec.Items.Add("Rogelio U.");
this.cmbmec.Items.Add("Serafín N.");
this.cmbmec.Items.Add("Victor A.");
this.cmblin.Enabled = true;
this.cmbequ.Enabled = false;
this.txtsub.Enabled = false;
this.txtdec.Enabled = false;
this.txtref.Enabled = false;
this.cmbtie.Enabled = false;
this.cmbherr.Enabled = false;
this.cmbrep.Enabled = false;
this.cmbent.Enabled = false;
this.cmblim.Enabled = false;
this.cmbhrs.Enabled = false;
this.cmbmcp.Enabled = false;
this.txtfec.Enabled = false;
this.txttie.Enabled = false;
this.txthor.Enabled = false;
this.cmbtur.Enabled = false;
this.cmbmes.Enabled = false;
this.cmbmec.Enabled = false;
this.btnenv.Enabled = false;

}

private void cmbequ_SelectedIndexChanged(object sender, EventArgs e)
{
this.cmbequ.Enabled = true;
this.txtsub.Enabled = true;
//this.cmblin = TextBoxBase;


}

private void cmblin_SelectedIndexChanged(object sender, EventArgs e)
{
this.cmblin.Enabled = true;
this.cmbequ.Enabled = true;
}

private void label1_Click(object sender, EventArgs e)
{

}

private void txtsub_TextChanged(object sender, EventArgs e)
{
this.txtsub.Enabled = true;
this.txtdec.Enabled = true;

}

private void txtdec_TextChanged(object sender, EventArgs e)
{
this.txtdec.Enabled = true;
this.txtref.Enabled = true;

}

private void txtref_TextChanged(object sender, EventArgs e)
{
this.txtref.Enabled = true;
this.cmbtie.Enabled = true;
}

private void cmbherr_SelectedIndexChanged(object sender, EventArgs e)
{
this.cmbherr.Enabled = true;
this.cmbrep.Enabled = true;

}

private void cmbent_SelectedIndexChanged(object sender, EventArgs e)
{
this.cmbent.Enabled = true;
this.cmblim.Enabled = true;
}

private void cmblim_SelectedIndexChanged(object sender, EventArgs e)
{
this.cmblim.Enabled = true;
this.cmbhrs.Enabled = true;
}

private void cmbhrs_SelectedIndexChanged(object sender, EventArgs e)
{
this.cmbhrs.Enabled = true;
this.cmbmcp.Enabled = true;
//txttot = cmbtie.Text + cmbherr.Text + cmbrep.Text + cmbent.Text + cmblim.Text + cmbhrs.Text;

}

private void cmbmcp_SelectedIndexChanged(object sender, EventArgs e)
{
this.cmbmcp.Enabled = true;
this.txtfec.Enabled = true;
}

private void txtfec_TextChanged(object sender, EventArgs e)
{
this.txtfec.Enabled = true;
this.txttie.Enabled = true;
}

private void cmbtur_SelectedIndexChanged(object sender, EventArgs e)
{
this.cmbtur.Enabled = true;
this.cmbmes.Enabled = true;
}

private void cmbmes_SelectedIndexChanged(object sender, EventArgs e)
{
this.cmbmes.Enabled = true;
this.cmbmec.Enabled = true;
}

private void cmbmec_SelectedIndexChanged(object sender, EventArgs e)
{
this.cmbmec.Enabled = true;
this.btnenv.Enabled = true;
}

private void txtfec_TextChanged_1(object sender, EventArgs e)
{

}

private void textBox1_TextChanged(object sender, EventArgs e)
{
this.txthor.Enabled = true;
this.cmbtur.Enabled = true;
}

private void button1_Click(object sender, EventArgs e)
{
Application.Exit();
}

private void timer1_Tick(object sender, EventArgs e)
{

}

private void txtfec_ValueChanged(object sender, EventArgs e)
{
this.txtfec.Enabled = true;//dateTimePicker1
this.txttie.Enabled = true;
}

private void txthor_MaskInputRejected(object sender, MaskInputRejectedEventArgs e)
{
this.txthor.Enabled = true;
this.cmbtur.Enabled = true;
}

private void txttie_MaskInputRejected_1(object sender, MaskInputRejectedEventArgs e)
{
this.txttie.Enabled = true;
this.txthor.Enabled = true;
}

private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e)
{

}

}
  #6 (permalink)  
Antiguo 04/11/2008, 11:36
Avatar de agressor  
Fecha de Ingreso: noviembre-2007
Ubicación: Knocking the Death Door..
Mensajes: 368
Antigüedad: 16 años, 5 meses
Puntos: 3
Respuesta: Ayuda con filtro combobox

Disculpa fue mi error no sabia en que trabajabas y asumi Visual Basic.. es casi igual a C#

using System.Windows.Forms;

public class Form1:
System.Windows.Forms.Form

{
public Form1() : base()
{
InitializeComboBox();
InitializeTextBox();
this.Label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
this.Label1.Location = new System.Drawing.Point(8, 24);
this.Label1.Name = "Label1";
this.Label1.Size = new System.Drawing.Size(120, 32);
this.Label1.TabIndex = 1;
this.Label1.Text = "Use drop-down to choose a name:";
this.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.Add(this.Label1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}

public static void Main()
{
Application.Run(new Form1());
}


internal System.Windows.Forms.Label Label1;




// Declare and initialize the text box.
// This text box text will be update programmatically. The user is not
// allowed to update it, so the ReadOnly property is set to true.
internal System.Windows.Forms.TextBox TextBox1;

private void InitializeTextBox()
{
this.TextBox1 = new System.Windows.Forms.TextBox();
this.TextBox1.ScrollBars = ScrollBars.Vertical;
this.TextBox1.Location = new System.Drawing.Point(64, 128);
this.TextBox1.Multiline = true;
this.TextBox1.Name = "TextBox1";
this.TextBox1.ReadOnly = true;
this.TextBox1.Size = new System.Drawing.Size(184, 120);
this.TextBox1.TabIndex = 4;
this.TextBox1.Text = "Employee and Number of Awards:";
this.Controls.Add(this.TextBox1);
}

// Declare comboBox1 as a ComboBox.
internal System.Windows.Forms.ComboBox ComboBox1;

// This method initializes the combo box, adding a large string array
// but limiting the drop-down size to six rows so the combo box doesn't
// cover other controls when it expands.
private void InitializeComboBox()
{
this.ComboBox1 = new System.Windows.Forms.ComboBox();
string[] employees = new string[]{"Hamilton, David", "Hensien, Kari",
"Hammond, Maria", "Harris, Keith", "Henshaw, Jeff D.",
"Hanson, Mark", "Harnpadoungsataya, Sariya",
"Harrington, Mark", "Harris, Keith", "Hartwig, Doris",
"Harui, Roger", "Hassall, Mark", "Hasselberg, Jonas",
"Harnpadoungsataya, Sariya", "Henshaw, Jeff D.",
"Henshaw, Jeff D.", "Hensien, Kari", "Harris, Keith",
"Henshaw, Jeff D.", "Hensien, Kari", "Hasselberg, Jonas",
"Harrington, Mark", "Hedlund, Magnus", "Hay, Jeff",
"Heidepriem, Brandon D."};

ComboBox1.Items.AddRange(employees);
this.ComboBox1.Location = new System.Drawing.Point(136, 32);
this.ComboBox1.MaxDropDownItems = 5;
this.ComboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
this.ComboBox1.Name = "ComboBox1";
this.ComboBox1.Size = new System.Drawing.Size(136, 81);
this.ComboBox1.TabIndex = 0;
this.Controls.Add(this.ComboBox1);

// Associate the event-handling method with the
// SelectedIndexChanged event.
this.ComboBox1.SelectedIndexChanged +=
new System.EventHandler(ComboBox1_SelectedIndexChanged );
}

// This method is called when the user changes his or her selection.
// It searches for all occurrences of the selected employee's
// name in the Items array and adds the employee's name and
// the number of occurrences to TextBox1.Text.

// CAUTION This code exposes a known bug: If the index passed to the
// FindStringExact(searchString, index) method is the last index
// of the array, the code throws an exception.
private void ComboBox1_SelectedIndexChanged(object sender,
System.EventArgs e)
{

ComboBox comboBox = (ComboBox) sender;

// Save the selected employee's name, because we will remove
// the employee's name from the list.
string selectedEmployee = (string) ComboBox1.SelectedItem;

int count = 0;
int resultIndex = -1;

// Call the FindStringExact method to find the first
// occurrence in the list.
resultIndex = ComboBox1.FindStringExact(selectedEmployee);

// Remove the name as it is found, and increment the found count.
// Then call the FindStringExact method again, passing in the
// index of the current found item so the search starts there
// instead of at the beginning of the list.
while (resultIndex!=-1)
{
ComboBox1.Items.RemoveAt(resultIndex);
count += 1;
resultIndex = ComboBox1.FindStringExact(selectedEmployee,
resultIndex);
}
// Update the text in Textbox1.
TextBox1.Text = TextBox1.Text+ "\r\n" + selectedEmployee + ": "
+ count;
}

}

Aqui te dejo este ejemplo.. solo cambia el contenido de While resultIndex!=-1 y colocas un SelectCase con el resultIndex como objeto a recibir..

Espero me entiendas..

Prueba y me cuenta..

Salu2..!!
__________________
Somos lo que nosotros queremos ni mas ni menos..
No hay dia mas perdido que aquel en que no hemos reido..
La vida es tal y como debe ser...
Nadie vivira por ti...
  #7 (permalink)  
Antiguo 04/11/2008, 11:46
Avatar de Reyscorpion  
Fecha de Ingreso: octubre-2008
Mensajes: 74
Antigüedad: 15 años, 6 meses
Puntos: 0
Respuesta: Ayuda con filtro combobox

Ok deja lo pruebo y te aviso como quedo, gracias de todas maneras
  #8 (permalink)  
Antiguo 05/11/2008, 10:09
Avatar de Reyscorpion  
Fecha de Ingreso: octubre-2008
Mensajes: 74
Antigüedad: 15 años, 6 meses
Puntos: 0
Respuesta: Ayuda con filtro combobox

No me queda me sigue marcando errores, crees que me puedas volver a ayudar lo que tengo aqui en mi tema es lo que aparece en el form1 y lo que a continuacion voy a poner viene en form1.designer
namespace WindowsFormsApplication5
{
partial class Form1
{
/// <summary>
/// Variable del diseñador requerida.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Limpiar los recursos que se estén utilizando.
/// </summary>
/// <param name="disposing">true si los recursos administrados se deben eliminar; false en caso contrario, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Código generado por el Diseñador de Windows Forms
/// <summary>
/// Método necesario para admitir el Diseñador. No se puede modificar
/// el contenido del método con el editor de código.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typ eof(Form1));
this.btnenv = new System.Windows.Forms.Button();
this.cmblin = new System.Windows.Forms.ComboBox();
this.lbllin = new System.Windows.Forms.Label();
this.lbleq = new System.Windows.Forms.Label();
this.cmbequ = new System.Windows.Forms.ComboBox();
this.cmbrep = new System.Windows.Forms.ComboBox();
this.cmblim = new System.Windows.Forms.ComboBox();
this.cmbhrs = new System.Windows.Forms.ComboBox();
this.cmbmcp = new System.Windows.Forms.ComboBox();
this.cmbtur = new System.Windows.Forms.ComboBox();
this.cmbtie = new System.Windows.Forms.ComboBox();
this.cmbherr = new System.Windows.Forms.ComboBox();
this.cmbent = new System.Windows.Forms.ComboBox();
this.cmbmec = new System.Windows.Forms.ComboBox();
this.cmbmes = new System.Windows.Forms.ComboBox();
(this.components);
this.button1 = new System.Windows.Forms.Button();
this.txtfec = new System.Windows.Forms.DateTimePicker();
this.txthor = new System.Windows.Forms.MaskedTextBox();
this.txttie = new System.Windows.Forms.MaskedTextBox();
this.dataSet1 = new System.Data.DataSet();
this.textBox1 = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.d ataSet1)).BeginInit();
this.SuspendLayout();
//
// btnenv
//
this.btnenv.BackColor = System.Drawing.Color.Transparent;
this.btnenv.Location = new System.Drawing.Point(396, 435);
this.btnenv.Name = "btnenv";
this.btnenv.Size = new System.Drawing.Size(109, 32);
this.btnenv.TabIndex = 0;
this.btnenv.Text = "Enviar";
this.btnenv.UseVisualStyleBackColor = false;
//
// cmblin
//
this.cmblin.FormattingEnabled = true;
this.cmblin.Location = new System.Drawing.Point(73, 15);
this.cmblin.Name = "cmblin";
this.cmblin.Size = new System.Drawing.Size(121, 21);
this.cmblin.TabIndex = 1;
this.cmblin.SelectedIndexChanged += new System.EventHandler(this.cmblin_SelectedIndexChang ed);
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(256, 206);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(100, 20);
this.textBox1.TabIndex = 47;
this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged_1);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this .BackgroundImage")));
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.ClientSize = new System.Drawing.Size(738, 517);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.txttie);
this.Controls.Add(this.txthor);
this.Controls.Add(this.txtfec);
this.Controls.Add(this.button1);
this.Controls.Add(this.txtref);
this.Controls.Add(this.txtdec);
this.Controls.Add(this.txtsub);
this.Controls.Add(this.cmbmes);
this.Controls.Add(this.cmbmec);
this.Controls.Add(this.cmbent);
this.Controls.Add(this.cmbherr);
this.Controls.Add(this.cmbtie);
this.Controls.Add(this.cmbtur);
this.Controls.Add(this.cmbmcp);
this.Controls.Add(this.cmbhrs);
this.Controls.Add(this.cmblim);
this.Controls.Add(this.cmbrep);
this.Controls.Add(this.cmbequ);
this.Controls.Add(this.lblmec);
this.Controls.Add(this.lblmes);
this.Controls.Add(this.lbltur);
this.Controls.Add(this.lbohor);
this.Controls.Add(this.lbltime);
this.Controls.Add(this.lblfec);
this.Controls.Add(this.lblmcp);
this.Controls.Add(this.lblfall);
this.Controls.Add(this.lbllim);
this.Controls.Add(this.lblent);
this.Controls.Add(this.lblrep);
this.Controls.Add(this.lblherr);
this.Controls.Add(this.lbltie);
this.Controls.Add(this.lblref);
this.Controls.Add(this.lbldes);
this.Controls.Add(this.lblsub);
this.Controls.Add(this.lbleq);
this.Controls.Add(this.lbllin);
this.Controls.Add(this.cmblin);
this.Controls.Add(this.btnenv);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
((System.ComponentModel.ISupportInitialize)(this.d ataSet1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btnenv;
private System.Windows.Forms.ComboBox cmblin;
private System.Windows.Forms.Label lbllin;
private System.Windows.Forms.Label lbleq;
private System.Windows.Forms.Label lblsub;
private System.Windows.Forms.Label lbldes;
private System.Windows.Forms.Label lblref;
private System.Windows.Forms.Label lbltie;
private System.Windows.Forms.Label lblherr;
private System.Windows.Forms.Label lblrep;
private System.Windows.Forms.Label lblent;
private System.Windows.Forms.Label lbllim;
private System.Windows.Forms.Label lblfall;
private System.Windows.Forms.Label lblmcp;
private System.Windows.Forms.Label lblfec;
private System.Windows.Forms.Label lbltime;
private System.Windows.Forms.Label lbohor;
private System.Windows.Forms.Label lbltur;
private System.Windows.Forms.Label lblmes;
private System.Windows.Forms.Label lblmec;
private System.Windows.Forms.ComboBox cmbequ;
private System.Windows.Forms.ComboBox cmbrep;
private System.Windows.Forms.ComboBox cmblim;
private System.Windows.Forms.ComboBox cmbhrs;
private System.Windows.Forms.ComboBox cmbmcp;
private System.Windows.Forms.ComboBox cmbtur;
private System.Windows.Forms.ComboBox cmbtie;
private System.Windows.Forms.ComboBox cmbherr;
private System.Windows.Forms.ComboBox cmbent;
private System.Windows.Forms.ComboBox cmbmec;
private System.Windows.Forms.ComboBox cmbmes;
private System.Windows.Forms.TextBox txtsub;
private System.Windows.Forms.TextBox txtdec;
private System.Windows.Forms.TextBox txtref;
private Microsoft.VisualBasic.PowerPacks.Printing.PrintFor m printForm1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.DateTimePicker txtfec;
private System.Windows.Forms.MaskedTextBox txthor;
private System.Windows.Forms.MaskedTextBox txttie;
private System.Data.DataSet dataSet1;
private System.Windows.Forms.TextBox textBox1;
}
}
No se si algo este haciendo mal, pero en base a lo ke te doy no se si me pudieras hacer el ejemplo del enlace y ya yo hago lo demas, espero que me haya dado a entender, gracias
  #9 (permalink)  
Antiguo 05/11/2008, 11:02
Avatar de agressor  
Fecha de Ingreso: noviembre-2007
Ubicación: Knocking the Death Door..
Mensajes: 368
Antigüedad: 16 años, 5 meses
Puntos: 3
Respuesta: Ayuda con filtro combobox

Hola mira te hice este ejemplo aclopalo al tuyo.. ojala te sirva y te de una idea..

private void Form1_Load(object sender, EventArgs e)
{
this.cmblin.Items.Add("Acabados");
this.cmblin.Items.Add("Adhesivos");
this.cmblin.Items.Add("Bob-Grande");
this.cmblin.Items.Add("Bob-Chica");
this.cmblin.Items.Add("Brodbeck");
this.cmblin.Items.Add("C-65");
this.cmblin.Items.Add("E-2");
this.cmblin.Items.Add("E-17");
this.cmblin.Items.Add("E-43");
this.cmblin.Items.Add("E-48");
this.cmblin.Items.Add("Embarques");
this.cmblin.Items.Add("Flejadora-1");
this.cmblin.Items.Add("Flejadora-2");
this.cmblin.Items.Add("Impresora-1");
this.cmblin.Items.Add("Impresora-2");
this.cmblin.Items.Add("IPD");
this.cmblin.Items.Add("J-1");
this.cmblin.Items.Add("J-2");
this.cmblin.Items.Add("J-3");
this.cmblin.Items.Add("L-1");
this.cmblin.Items.Add("L-2");
this.cmblin.Items.Add("L-3");
this.cmblin.Items.Add("Lhomme");
this.cmblin.Items.Add("Manufacturas");
this.cmblin.Items.Add("Paco-1");
this.cmblin.Items.Add("Paco-2");
this.cmblin.Items.Add("Shelfton");
this.cmblin.Items.Add("Tureti");
}

private void cmblin_SelectedIndexChanged(object sender, EventArgs e)
{
int n = int.Parse(e);
switch (n)
{
case 1:
this.cmbequ.DataSource = null;
this.cmbequ.add("Creel");
this.cmbequ.add("Adhesivos");
this.cmbequ.add("Conveyor");
case 2:
Console.WriteLine("Case 2");
break;
default:
Console.WriteLine("Default case");
break;
}



}

Salu2..!!
__________________
Somos lo que nosotros queremos ni mas ni menos..
No hay dia mas perdido que aquel en que no hemos reido..
La vida es tal y como debe ser...
Nadie vivira por ti...
  #10 (permalink)  
Antiguo 05/11/2008, 11:52
Avatar de Reyscorpion  
Fecha de Ingreso: octubre-2008
Mensajes: 74
Antigüedad: 15 años, 6 meses
Puntos: 0
Respuesta: Ayuda con filtro combobox

Gracias agressor por el aporte aunke ahora disculpa que te moleste pero me aparece que esperaba un identificador y el error se lo pone en el "=" y me pide un ";" y me pone el error en el int practicamente en esta linea

int = n int.Parse(e);
switch (n)

espero me puedas ayudar gracias
  #11 (permalink)  
Antiguo 05/11/2008, 13:53
Avatar de agressor  
Fecha de Ingreso: noviembre-2007
Ubicación: Knocking the Death Door..
Mensajes: 368
Antigüedad: 16 años, 5 meses
Puntos: 3
Respuesta: Ayuda con filtro combobox

Aqui te dejo la funcion ya funcional.. debido a un problema con la conversion..

private void cmblin_SelectedIndexChanged(object sender, EventArgs e)
{
int ndx = cmblin.SelectedIndex;
string item = (string)cmblin.SelectedItem;
switch (item)
{
case "Acabados":
this.cmbequ.Items.Clear();
this.cmbequ.Items.Add("Creel");
this.cmbequ.Items.Add("Adhesivos");
this.cmbequ.Items.Add("Conveyor");
break;
case "Adhesivos":
this.cmbequ.Items.Clear();
this.cmbequ.DataSource = null;
this.cmbequ.Items.Add("Hola");
this.cmbequ.Items.Add("ESto");
this.cmbequ.Items.Add("es otro");
break;

}

Ahora si te debe funcionar ya la probe XDD

Salu2..!!
__________________
Somos lo que nosotros queremos ni mas ni menos..
No hay dia mas perdido que aquel en que no hemos reido..
La vida es tal y como debe ser...
Nadie vivira por ti...
  #12 (permalink)  
Antiguo 06/11/2008, 07:20
Avatar de Reyscorpion  
Fecha de Ingreso: octubre-2008
Mensajes: 74
Antigüedad: 15 años, 6 meses
Puntos: 0
Respuesta: Ayuda con filtro combobox

Wow!! agressor

la verdfad es que te estoy muy pero muy agradecido porque creeme que me acabas de sacar de un problemon grandisimo aunque lo debia presentar el viernes pasado pero pues me dieron una prorroga y creeme que con el resultado obtenido esto va a quedar mas que satisfecho para ellos, te lo agradezco mucho y pues la verdad soy nuevo en este foro y no se si te pueda dar alguna puntuacion o algo porque te mereces no un 10 sino un 100 gracias amigo
  #13 (permalink)  
Antiguo 06/11/2008, 07:23
Avatar de agressor  
Fecha de Ingreso: noviembre-2007
Ubicación: Knocking the Death Door..
Mensajes: 368
Antigüedad: 16 años, 5 meses
Puntos: 3
Respuesta: Ayuda con filtro combobox

Dale me alegro haberte ayudado y asistido aunque no manejo muy bien C# pero se hace lo que se puede aqui lo que se da es Karma.. es en el simbolo del Ying Yang o Equilibrio que ves abajo..

Salu2..!!
__________________
Somos lo que nosotros queremos ni mas ni menos..
No hay dia mas perdido que aquel en que no hemos reido..
La vida es tal y como debe ser...
Nadie vivira por ti...
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 08:56.