private void textBox1_TextChanged(object sender, EventArgs e) { BPanel.Controls.Clear(); BPanel.BringToFront(); y = 6; var tamanio = 0; BPanel.Height = tamanio; if (TBuscar.Text != "" && TBuscar.Text != "Buscar") { BPanel.Visible = false; var lista = proxy.Buscar(_name, TBuscar.Text); foreach (var item in lista) { var perfil = new ConstructorPerfilBusqueda(BPanel, 0, y, PerfilUsuario, item).CrearObjeto(); perfil.crearPanel(); tamanio += perfil.obtenerPanel().Height; if (tamanio < 220) { BPanel.Height = tamanio + 8; } BPanel.Controls.Add(perfil.obtenerPanel()); y += 44; } BPanel.Visible = true; } else { BPanel.Visible = false; } }
public Inicio(string data) { string url = Directory.GetCurrentDirectory(); for (int i = 0; i < url.Length - 9; i++) { newURL += url[i]; } proxy = new ProxyInstagram(); var res = proxy.GetUser(data); name = res.user; // DB User InitializeComponent(); TopPanel.SendToBack(); button2.FlatAppearance.BorderSize = 0; button3.FlatAppearance.BorderSize = 0; button4.FlatAppearance.BorderSize = 0; ConfigPanel.Visible = false; PostsPanel.AutoScroll = true; StoryPanel.AutoScroll = true; this.ActiveControl = PostsPanel; BPanel.BringToFront(); BPanel.AutoScroll = true; BPanel.Visible = false; BPanel.BorderStyle = BorderStyle.FixedSingle; this.Controls.Add(BPanel); ConfigPanel.BorderStyle = BorderStyle.FixedSingle; NombreUsuario.Text = res.user; NombreCompleto.Text = res.nombre; var urlimage = newURL + res.foto; Image image = Image.FromFile(urlimage); ImagenPerfil.Image = image; ImagenPerfil.Width = 44; ImagenPerfil.Height = 44; //Cargar Feed DB var insta = proxy.GetFeed(res.user); foreach (Post item in insta.publico) { var post = new ConstructorPosts(PostsPanel, 0, y, PerfilUsuario, item, name, UpdatePosts, this).CrearObjeto(); post.crearPanel(); PostsPanel.Controls.Add(post.obtenerPanel()); y += post.obtenerPanel().Height + 20; } // My Stories if (insta.stories.stories.Count > 0) { var Mystory = new ConstructorStories(StoryPanel, 0, y2, StorieUsuario, insta.stories, res.user, UpdateStories).CrearObjeto(); Mystory.crearPanel(); StoryPanel.Controls.Add(Mystory.obtenerPanel()); y2 += StoryPanel.Height / 6 + 10; } // foreach (Stories item in insta.publicStories) { var story = new ConstructorStories(StoryPanel, 0, y2, StorieUsuario, item, res.user, UpdateStories).CrearObjeto(); story.crearPanel(); StoryPanel.Controls.Add(story.obtenerPanel()); y2 += StoryPanel.Height / 6 + 10; } }