473,545 Members | 2,388 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to create popup window at run time?

7 New Member
Hi All,

I am new to vb.net, Can anybody tell how to create a pop up window at runtime. If I have more than 100 product names in the database, While I click the letter 'A' in text box, the window should be open and all the product names starts with letter 'A' should listed in the window in ascending order. (similarly A to Z)
Jul 2 '07 #1
5 2069
Vidhura
99 New Member
Hi All,

I am new to vb.net, Can anybody tell how to create a pop up window at runtime. If I have more than 100 product names in the database, While I click the letter 'A' in text box, the window should be open and all the product names starts with letter 'A' should listed in the window in ascending order. (similarly A to Z)
Create form instance and show

Dim frm as Form
frm=new form()
frm.show()
Jul 2 '07 #2
robertaraj
7 New Member
Create form instance and show

Dim frm as Form
frm=new form()
frm.show()
Hi Vidhura,
Above codes are to show one form to another, like link. But I am asking the main form should not hide or close. The window should be opened. (For example you might have seen this in medical shop or library in search of item name or books)
Jul 2 '07 #3
Vidhura
99 New Member
Hi Vidhura,
Above codes are to show one form to another, like link. But I am asking the main form should not hide or close. The window should be opened. (For example you might have seen this in medical shop or library in search of item name or books)
The main form will not be hide or close if you open another form,unless otherwise you specify mainform.hide or mainform.close
you can design the form as like popup window and can show the values.
Jul 2 '07 #4
robertaraj
7 New Member
The main form will not be hide or close if you open another form,unless otherwise you specify mainform.hide or mainform.close
you can design the form as like popup window and can show the values.
Is it possible to design form as popup window? How?? That's the thing I'm asking.
Jul 2 '07 #5
Vidhura
99 New Member
Is it possible to design form as popup window? How?? That's the thing I'm asking.
1.Open new window form.Set the controlbox property to false.Resize the window form as per your requirment.

2.Add label to show the names or texts.Set the Autosize to true

3.Add button control.Add this.close in button click event

Here i m giving sample code

This is the form designer for popup window

Expand|Select|Wrap|Line Numbers
  1. namespace TestCombo
  2. {
  3.    partial class Form1
  4.    {
  5.       /// <summary>
  6.       /// Required designer variable.
  7.       /// </summary>
  8.       private System.ComponentModel.IContainer components = null;
  9.  
  10.       /// <summary>
  11.       /// Clean up any resources being used.
  12.       /// </summary>
  13.       /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
  14.       protected override void Dispose(bool disposing)
  15.       {
  16.          if (disposing && (components != null))
  17.          {
  18.             components.Dispose();
  19.          }
  20.          base.Dispose(disposing);
  21.       }
  22.  
  23.       #region Windows Form Designer generated code
  24.  
  25.       /// <summary>
  26.       /// Required method for Designer support - do not modify
  27.       /// the contents of this method with the code editor.
  28.       /// </summary>
  29.       private void InitializeComponent()
  30.       {
  31.          this.btnOK = new System.Windows.Forms.Button();
  32.          this.label1 = new System.Windows.Forms.Label();
  33.          this.SuspendLayout();
  34.          // 
  35.          // btnOK
  36.          // 
  37.          this.btnOK.Location = new System.Drawing.Point(108, 203);
  38.          this.btnOK.Name = "btnOK";
  39.          this.btnOK.Size = new System.Drawing.Size(75, 23);
  40.          this.btnOK.TabIndex = 0;
  41.          this.btnOK.Text = "OK";
  42.          this.btnOK.UseVisualStyleBackColor = true;
  43.          this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
  44.          // 
  45.          // label1
  46.          // 
  47.          this.label1.AutoSize = true;
  48.          this.label1.Location = new System.Drawing.Point(105, 74);
  49.          this.label1.Name = "label1";
  50.          this.label1.Size = new System.Drawing.Size(0, 13);
  51.          this.label1.TabIndex = 1;
  52.          // 
  53.          // Form1
  54.          // 
  55.          this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
  56.          this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
  57.          this.ClientSize = new System.Drawing.Size(261, 266);
  58.          this.ControlBox = false;
  59.          this.Controls.Add(this.label1);
  60.          this.Controls.Add(this.btnOK);
  61.          this.Name = "Form1";
  62.          this.Text = "Form1";
  63.          this.Load += new System.EventHandler(this.Form1_Load);
  64.          this.ResumeLayout(false);
  65.          this.PerformLayout();
  66.  
  67.       }
  68.  
  69.       #endregion
  70.  
  71.       private System.Windows.Forms.Button btnOK;
  72.       private System.Windows.Forms.Label label1;
  73.    }
  74. }
  75.  
This .cs file to write ur methods and events

Expand|Select|Wrap|Line Numbers
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Text;
  7. using System.Windows.Forms;
  8.  
  9. namespace TestCombo
  10. {
  11.    public partial class Form1 : Form
  12.    {
  13.       string result;
  14.       public Form1(string str)
  15.       {
  16.          result = str;
  17.          InitializeComponent();
  18.       }
  19.  
  20.       private void btnOK_Click(object sender, EventArgs e)
  21.       {
  22.          this.Close();
  23.       }
  24.  
  25.       private void Form1_Load(object sender, EventArgs e)
  26.       {
  27.          this.label1.Text = result;
  28.       }
  29.    }
  30. }
  31.  
  32.  

The following is the sample code to call this popup window

Expand|Select|Wrap|Line Numbers
  1.  private void button1_Click(object sender, EventArgs e)
  2.       {
  3.          Form1 frm = new Form1("Hi this is");
  4.          frm.Show();
  5.  
  6.       }
  7.  
Jul 2 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

17
2496
by: Applebrownbetty | last post by:
Hi, I'd like to append/amend the following code from the Dreamweaver extension "Open Picture Window Fever" for the ability to center the PopUp window: By default, it allows the window to be offset on the left and top, but does not include a centering option. I'm thinking it would include something like (screen.width-imageWidth)/2;...
7
3205
by: E Michael Brandt | last post by:
I have been lurking here for some time, and now would like to ask a question of you clever coders: My JustSo PictureWindow 3 Extension for Dreamweaver has stumbled in the face of the new Opera 8. Jspw3 opens a popup window (using varname=window.open(...)) but there are now two problems: 1) Opera8 interprets a top,left of 0,0 to be top...
19
13318
by: Davey | last post by:
I have a popup window that opens using the following function. Unfortunately when this function (or any other popup generating function) is called from *within* a popup, it opens it within the current popup (i.e. it doesn't spawn another child popup). How can I get it to open up another popup window? function popobjed(url) { var...
3
1984
by: ypress | last post by:
Hi. I have a page that contains this simple function: <script language="javascript"> function openPop(url, name, w, h) { var features = ""; features += "scrollbars=no,"; features += "menubar=no,"; features += "resizable=no,";
0
435
by: ChrisB | last post by:
I'm attempting to open a new window from a LinkButton in a DataGrid. I can set a session variable in the ItemCommand event for the LinkButton like so: // this is used to handle the ItemCommand event private void itmCmd(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e) { string itemGFNo = ""; if (e.CommandName ==...
2
2086
by: Novice | last post by:
Hi all, as you can see from the subject, I'm try to use an asp:button to create a new browser window and output contents to new window But default if I do the Response.Write("..." The output gets sent directly to the window or frame that the button was contained in - if I was using regular anchor links I could just specify the target - i.e....
1
11545
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at http://weblogs.asp.net/asmith/archive/2003/09/15/27684.aspx but it was far more complex then I needed. (I got lost trying to figure it all...
1
2019
by: Jennyfer J Barco | last post by:
Hello I have a datagrid and a linkbuttom in the datagrid that says Picture, every time I click on the link "Picture" my program opens a popup window showing a picture of the item the selected and information about the item. On the html of the datagrid I have the following: OnItemCommand="Grid_CartCommand" OnItemCreated="DataGrid_ItemCreated"....
7
3653
by: anthony.turcotte | last post by:
Hi, I've looked for a solution to this problem on google, read posts in this newsgroup and I still haven't found anything that could help me. Here's the scenario. 1. User accesses pageA.html 2. User clicks on menu link to open popup.html 3. pageA.html checks if popup.html is already open. It is not, open
11
5274
by: V S Rawat | last post by:
using Javascript, I am opening a web-based url in a popup window. MyWin1=Window.Open(url, "mywindow") There is a form (form1) in the url in that popup window, I need to submit that form. How do I submit that form1 from the javascript from my current window? Thanks.
0
7487
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7420
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7680
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7934
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7778
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6003
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5349
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
1
1033
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
731
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.