下拉文本选择

aspx:
ExpandedBlockStart.gif ContractedBlock.gif <% dot.gif @ Page Language="C#" AutoEventWireup="true" CodeFile="AddShip.aspx.cs" Inherits="ShipAgency_AddShip"   %>
None.gif
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
None.gif
< html  xmlns ="http://www.w3.org/1999/xhtml"   >
None.gif
< head  runat ="server" >
None.gif    
< title > 新增船舶规范 </ title >
None.gif  
< link  href ="../css/register.css"  rel ="Stylesheet"  type ="text/css" />
None.gif 
< link  href ="../css/BgImage.css"  rel ="Stylesheet"  type ="text/css" />
None.gif
ExpandedBlockStart.gifContractedBlock.gif      
< script  type ="text/javascript" > dot.gif
InBlock.gif 
ExpandedSubBlockStart.gifContractedSubBlock.gif      onload
= function foo() dot.gif{
InBlock.gif        
//国籍
InBlock.gif
        var dataSource = [];
InBlock.gif        dataSource
= ShipAgency_AddShip.GetSearchItemsListCountry();
InBlock.gif        
var textBox = document.getElementById("tbxAddNationality");
ExpandedSubBlockStart.gifContractedSubBlock.gif        
var configs = dot.gif{
InBlock.gif          instanceName: 
"auto",
InBlock.gif          textbox: textBox,
InBlock.gif          dataSource: dataSource.value
ExpandedSubBlockEnd.gif        }

InBlock.gif        window.auto 
= new neverModules.modules.autocomplete(configs);
InBlock.gif        
InBlock.gif        
//目的港
InBlock.gif
        var dataSourcePort = [];
InBlock.gif        dataSourcePort 
= ShipAgency_AddShip.GetSearchItemsListPort();
InBlock.gif        
var textBox_tbxAddSHIPPORT = document.getElementById("tbxAddSHIPPORT");
ExpandedSubBlockStart.gifContractedSubBlock.gif        
var configs_tbxAddSHIPPORT = dot.gif{
InBlock.gif          instanceName: 
"auto_tbxAddSHIPPORT",
InBlock.gif          textbox: textBox_tbxAddSHIPPORT,
InBlock.gif          dataSource: dataSourcePort.value
ExpandedSubBlockEnd.gif        }

InBlock.gif        window.auto_tbxAddSHIPPORT 
= new neverModules.modules.autocomplete(configs_tbxAddSHIPPORT);
InBlock.gif
ExpandedSubBlockEnd.gif      }

InBlock.gif 
ExpandedBlockEnd.gif    
</ script >
None.gif      
< script  type = "text/javascript"  src ="../JS/autocomplete_extras.js" ></ script >
None.gif   
< link  href ="../css/autocomplete_custom_main.css"  rel ="Stylesheet"  type ="text/css" />
None.gif   
< link  href ="../css/autocomplete_custom.css"  rel ="Stylesheet"  type ="text/css" />
None.gif
None.gif
</ head >
None.gif
< body >
None.gif    
< form  id ="form1"  runat ="server" >
None.gif    
< div >< table  width ="100%"  border ="0"  align ="center"  cellpadding ="0"  cellspacing ="0"  id ="__01" >
None.gif    
None.gif    
None.gif    
< tr  valign ="top"   >
None.gif        
< td  colspan ="0"  style ="height: 500px" >             
None.gif          
< div  align ="center" >
None.gif            
< TABLE  width ="100%"  border =0  align ="center"  bordercolor ="#000000" >
None.gif              
< TBODY >
None.gif                
< TR >
None.gif                  
< TD  >< FIELDSET >
None.gif                    
< LEGEND  accessKey =F  align =left >< span  class ="style3" > 船舶规范 </ span ></ LEGEND >
None.gif                      
< table  align ="center"  border ="0"  cellpadding ="0"  cellspacing ="2"  width ="95%" >
None.gif                          
< tbody >
None.gif                              
< tr >
None.gif                                  
< td  nowrap ="nowrap"  style ="width: 79px; height: 18px;"  align ="right" >
None.gif                                      
< div  align ="right" >
None.gif                                          注册港:
</ div >
None.gif                                  
</ td >
None.gif                                  
< td  style ="text-align: left; height: 18px; width: 160px;" >< input  name ="tbxAddSHIPPORT"  type ="text"  id ="tbxAddSHIPPORT"   onkeyup ="auto_tbxAddSHIPPORT.handlerEvent(event);"  runat ="server"  style ="width: 308px" ></ td >
None.gif                                  
< td  style ="height: 17px; width: 82px;"  align ="right" >
None.gif                                      
< div  align ="right" >
None.gif                                          
&nbsp; </ div >
None.gif                                  
</ td >
None.gif                                  
< td  style ="width: 164px; text-align: left; height: 18px;" >
None.gif                                      
</ td >
None.gif                                  
< td  style ="height: 18px; width: 67px;"  align ="right" >
None.gif                                      
< span  style ="color: #ff0000" > * </ span > 国籍: </ td >
None.gif                                  
< td  style ="height: 18px" >
None.gif                                   
< input  name ="tbxAddNationality"  type ="text"  id ="tbxAddNationality"   onkeyup ="auto.handlerEvent(event);"  runat ="server"  style ="width: 126px" ></ td >
None.gif                              
</ tr >
None.gif                          
</ tbody >
None.gif                      
</ table >
None.gif                    
< br >
None.gif                      
</ FIELDSET ></ TD >
None.gif                
</ TR >
None.gif              
</ TBODY >
None.gif            
</ TABLE >
None.gif         
</ div ></ td >
None.gif  
</ tr >
None.gif
</ table >      </ div >
None.gif    
</ form >
None.gif
</ body >
None.gif
</ html >
None.gif

cs:
None.gif using  System;
None.gif
using  System.Data;
None.gif
using  System.Configuration;
None.gif
using  System.Collections;
None.gif
using  System.Web;
None.gif
using  System.Web.Security;
None.gif
using  System.Web.UI;
None.gif
using  System.Web.UI.WebControls;
None.gif
using  System.Web.UI.WebControls.WebParts;
None.gif
using  System.Web.UI.HtmlControls;
None.gif
None.gif
using  AjaxPro;
None.gif
using  System.Data.OracleClient;
None.gif
None.gif
public  partial  class  ShipAgency_AddShip : System.Web.UI.Page
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif    
protected void Page_Load(object sender, EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        
// 在此处放置用户代码以初始化页面
InBlock.gif
        Utility.RegisterTypeForAjax(typeof(ShipAgency_AddShip));
InBlock.gif        
if (!IsPostBack)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockEnd.gif    }

InBlock.gif
InBlock.gif
InBlock.gif    [AjaxMethod()]
InBlock.gif    
public ArrayList GetSearchItemsListCountry(string query)
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        ArrayList items 
= new ArrayList();
InBlock.gif
InBlock.gif        
string myConnectionString = LTP.Common.DEncrypt.DESEncrypt.Decrypt(LTP.Common.ConfigHelper.GetConfigString("ConnectionString"));
InBlock.gif        
//"Data Source=JOINTWIN;Persist Security Info=True;User ID=penavico;Password=JointWin2007;Unicode=True";
InBlock.gif
        string mySelectQuery =
InBlock.gif            
string.Format(
InBlock.gif            
"select code,cn from country where code like '{0}%' and cn is not null",
InBlock.gif            query);
InBlock.gif        OracleConnection myConnection 
= new OracleConnection(myConnectionString);
InBlock.gif        OracleCommand myCommand 
= new OracleCommand(mySelectQuery, myConnection);
InBlock.gif        myConnection.Open();
InBlock.gif        OracleDataReader myReader 
=
InBlock.gif            myCommand.ExecuteReader(CommandBehavior.CloseConnection);
InBlock.gif        
while (myReader.Read())
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            items.Add(myReader.GetString(
0+ "|" + myReader.GetString(1));
ExpandedSubBlockEnd.gif        }

InBlock.gif        myReader.Close();
InBlock.gif
InBlock.gif        
return items;
ExpandedSubBlockEnd.gif    }

InBlock.gif
InBlock.gif    [AjaxMethod()]
InBlock.gif    
public string[] GetSearchItemsListPort(string query)
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        ArrayList items 
= new ArrayList();
InBlock.gif
InBlock.gif        
string myConnectionString = LTP.Common.DEncrypt.DESEncrypt.Decrypt(LTP.Common.ConfigHelper.GetConfigString("ConnectionString"));
InBlock.gif        
string mySelectQuery =
InBlock.gif            
string.Format(
InBlock.gif            
"select en,cn from port where en like '{0}%' and cn is not null",
InBlock.gif            query);
InBlock.gif        OracleConnection myConnection 
= new OracleConnection(myConnectionString);
InBlock.gif        OracleCommand myCommand 
= new OracleCommand(mySelectQuery, myConnection);
InBlock.gif        myConnection.Open();
InBlock.gif        OracleDataReader myReader 
=
InBlock.gif            myCommand.ExecuteReader(CommandBehavior.CloseConnection);
InBlock.gif        
while (myReader.Read())
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            items.Add(myReader.GetString(
0+ "|" + myReader.GetString(1));
ExpandedSubBlockEnd.gif        }

InBlock.gif        myReader.Close();
InBlock.gif
InBlock.gif        
//String[] returnList = (String[])items.ToArray(new String[items.Count]);
InBlock.gif
InBlock.gif        
// String[] strList = new String[items.Count];
InBlock.gif        
// String[] returnList = (String[])items.ToArray(strList);
InBlock.gif
InBlock.gif        
// string[] returnList = (string[])items.ToArray(new string[items.Count]);
InBlock.gif
        string[] returnList = new string[items.Count];
InBlock.gif        
for (int i = 0; i < items.Count; i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            returnList[i] 
= items[i].ToString();
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
return returnList;
ExpandedSubBlockEnd.gif    }

InBlock.gif
ExpandedBlockEnd.gif}

None.gif
下载: /Files/ipusr/DownText.rar
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
您可以使用EasyX图形库中的下拉框控件来实现滚轮下拉文本的效果。具体实现步骤如下: 1. 创建下拉框控件,设置其初始状态为不可见。 2. 在窗口的消息循环中,监听鼠标滚轮事件。 3. 当鼠标滚轮事件发生时,判断鼠标位置是否在下拉框控件的区域内。 4. 如果是,则将下拉框控件设置为可见,并根据鼠标位置计算出下拉框的位置。 5. 如果不是,则将下拉框控件设置为不可见。 以下是示例代码: ```c++ #include <graphics.h> int main() { initgraph(640, 480); // 创建下拉框控件 IMAGE dropdown(100, 20); setbkcolor(WHITE); setfillcolor(WHITE); fillrectangle(0, 0, 100, 20); settextcolor(BLACK); settextstyle(16, 0, _T("宋体")); outtextxy(10, 3, _T("选项1\n选项2\n选项3")); setlinecolor(BLACK); rectangle(0, 0, 100, 20); // 设置下拉框控件初始状态为不可见 bool dropdownVisible = false; while (true) { // 监听鼠标滚轮事件 if (MouseWheelMove()) { // 获取鼠标位置 int mouseX = GetMouseX(); int mouseY = GetMouseY(); // 判断鼠标位置是否在下拉框控件的区域内 if (mouseX >= 100 && mouseX <= 200 && mouseY >= 20 && mouseY <= 60) { // 计算下拉框的位置 int dropdownX = mouseX; int dropdownY = mouseY + 10; // 设置下拉框控件为可见 dropdownVisible = true; } else { // 设置下拉框控件为不可见 dropdownVisible = false; } } // 绘制窗口内容 cleardevice(); if (dropdownVisible) { putimage(dropdownX, dropdownY, &dropdown); } flushbatch(); Sleep(10); } closegraph(); return 0; } 相关问题:
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值