求vb程序设计实例 要求有1000行左右 紧急 明天中午就要了

?小小静? 2024-12-01 12:50:38
最佳回答
这是一个获取股票实时报价的程序,这程序有一个窗体,一个模块窗体代码:option explicitdim g_strsymbol as stringdim nrow as integerdim csymboll**t as collectiondim casyncsymboll**t as collectiondim cregsymbols as collectiondim bquotesreg**tered as booleanprivate sub asynctimer_timer() if basync**ailable then if casyncsymboll**t.count < 1 then if bregquotes then reg**tersymbols csymboll**t end if asynctimer.enabled = false basync**ailable = false exit sub end if dim stritem as string stritem = "~getquote," & casyncsymboll**t.item(1) casyncsymboll**t.remove 1 dde_request "q", stritem, true basync**ailable = false end ifend subprivate sub command1_click() dim bloop as boolean dim strfieldvalue as string dim ncomma as long bloop = true dim ncounter as integer dim svalue as string dereg**terregsymbols bquotesreg**tered = false flexgrid1.clear do while csymboll**t.count() > 0 csymboll**t.remove 1 loop do while casyncsymboll**t.count() > 0 casyncsymboll**t.remove 1 loop svalue = lblsymbol do while bloop = true ncomma = instr(svalue, ",") if (ncomma < 1) then if (len(svalue) > 0) then bloop = false strfieldvalue = svalue svalue = right(svalue, len(svalue) - ncomma) else exit do end if else strfieldvalue = left(svalue, ncomma - 1) svalue = right(svalue, len(svalue) - ncomma) end if casyncsymboll**t.add strfieldvalue csymboll**t.add strfieldvalue loop flexgrid1.cols = 10 'flexgrid1.colwidth(0) = 2000 'flexgrid1.colwidth(5) = 1500 flexgrid1.fixedcols = 0 flexgrid1.fixedrows = 1 if (csymboll**t.count() > 0) then flexgrid1.rows = csymboll**t.count() + 1 else flexgrid1.rows = 2 end if flexgrid1.textarray(0) = "sym" flexgrid1.textarray(1) = "last" flexgrid1.textarray(2) = "chg" flexgrid1.textarray(3) = "bid" flexgrid1.textarray(4) = "ask" flexgrid1.textarray(5) = "last size" flexgrid1.textarray(6) = "high" flexgrid1.textarray(7) = "low" flexgrid1.textarray(8) = "vol" flexgrid1.textarray(9) = "last time" dim stritem as string if bregquotes then bquotesreg**tered = true end if if optasync.value = true then asynctimer.enabled = true if csymboll**t.count > 0 then stritem = "~getquote," & casyncsymboll**t.item(1) casyncsymboll**t.remove 1 dde_request "q", stritem, true end if else 'topic = "q" item = "~getquote,msft" dim ncount as integer dim x as integer x = 1 ncount = csymboll**t.count() do while ncount + 1 > x stritem = "~getquote," & csymboll**t.item(x) dde_request "q", stritem, false x = x + 1 loop if bregquotes then reg**tersymbols csymboll**t end if end ifend subprivate sub flexgrid1_click()end subprivate sub form_load() set csymboll**t = new collection set casyncsymboll**t = new collection set cregsymbols = new collection optsync.value = true ''''''''''''''''''''''''''''''''''''''' 'dde init ''''''''''''''''''''''''''''''''''''''' g_linstid = 0 if ddeinitialize(g_linstid, addressof ddecallback, appcmd_clientonly or mf_sendmsgs or mf_postmsgs, 0) then debug.print "dde initialize failure." translateerror else debug.print "dde initialize success." end if 'connect dde dde_createstringhandles "stidde", "q", "" 'open the conversation. if (g_hddeconv = 0) then g_hddeconv = dde_connect end if dde_freestringhandlesend subprivate sub form_unload(cancel as integer)on error resume next dereg**terregsymbols if (g_hddeconv <> 0) then dde_d**connect end ifend subpublic sub updatefield(strsymbol as string, fieldindex as integer, fieldvalue as string) dim bfound as boolean dim nrow as integer dim ncount as integer dim x as integer x = 1 ncount = csymboll**t.count() do while not bfound and x < (ncount + 1) if strsymbol = csymboll**t.item(x) then bfound = true nrow = x end if x = x + 1 loop if bfound then flexgrid1.textarray(fieldindex + (nrow * 10)) = fieldvalue flexgrid1.textarray(nrow * 10) = strsymbol end ifend subprivate sub lblsymbol_change() dim selpos as integer selpos = lblsymbol.selstart lblsymbol = ucase(lblsymbol) lblsymbol.selstart = selposend subprivate sub reg**terallsymbolvalues(csymboll**t as collection) dim x as integer dim ncount as integer ncount = csymboll**t.count() x = 1 do while ncount + 1 > x dde_adv**e "q", csymboll**t.item(x) & "," & q_last, "" dde_adv**e "q", csymboll**t.item(x) & "," & q_chg, "" dde_adv**e "q", csymboll**t.item(x) & "," & q_bid, "" dde_adv**e "q", csymboll**t.item(x) & "," & q_ask, "" dde_adv**e "q", csymboll**t.item(x) & "," & q_last_sz, "" dde_adv**e "q", csymboll**t.item(x) & "," & q_high, "" dde_adv**e "q", csymboll**t.item(x) & "," & q_low, "" dde_adv**e "q", csymboll**t.item(x) & "," & q_vol, "" dde_adv**e "q", csymboll**t.item(x) & "," & q_last_time, "" x = x + 1 loopend subprivate sub reg**tersymbol(strsymbol as string) dde_adv**e "q", strsymbol & "," & q_last, "" dde_adv**e "q", strsymbol & "," & q_chg, "" dde_adv**e "q", strsymbol & "," & q_bid, "" dde_adv**e "q", strsymbol & "," & q_ask, "" dde_adv**e "q", strsymbol & "," & q_last_sz, "" dde_adv**e "q", strsymbol & "," & q_high, "" dde_adv**e "q", strsymbol & "," & q_low, "" dde_adv**e "q", strsymbol & "," & q_vol, "" dde_adv**e "q", strsymbol & "," & q_last_time, "" cregsymbols.add strsymbolend subprivate sub reg**tersymbols(csymbols as collection) dim x as integer dim ncount as integer ncount = csymbols.count() x = 1 do while ncount + 1 > x dde_adv**e "q", csymbols.item(x) & "," & q_last, "" dde_adv**e "q", csymbols.item(x) & "," & q_chg, "" dde_adv**e "q", csymbols.item(x) & "," & q_bid, "" dde_adv**e "q", csymbols.item(x) & "," & q_ask, "" dde_adv**e "q", csymbols.item(x) & "," & q_last_sz, "" dde_adv**e "q", csymbols.item(x) & "," & q_high, "" dde_adv**e "q", csymbols.item(x) & "," & q_low, "" dde_adv**e "q", csymbols.item(x) & "," & q_vol, "" dde_adv**e "q", csymbols.item(x) & "," & q_last_time, "" cregsymbols.add csymbols.item(x) x = x + 1 loopend subprivate sub dereg**terregsymbols() dim x as integer dim ncount as integer ncount = cregsymbols.count() x = 1 do while ncount + 1 > x dde_adv**estop "q", cregsymbols.item(x) & "," & q_last, "" dde_adv**estop "q", cregsymbols.item(x) & "," & q_chg, "" dde_adv**estop "q", cregsymbols.item(x) & "," & q_bid, "" dde_adv**estop "q", cregsymbols.item(x) & "," & q_ask, "" dde_adv**estop "q", cregsymbols.item(x) & "," & q_last_sz, "" dde_adv**estop "q", cregsymbols.item(x) & "," & q_high, "" dde_adv**estop "q", cregsymbols.item(x) & "," & q_low, "" dde_adv**estop "q", cregsymbols.item(x) & "," & q_vol, "" dde_adv**estop "q", cregsymbols.item(x) & "," & q_last_time, "" x = x + 1 loop 'clear out x = 1 do while cregsymbols.count > 0 cregsymbols.remove 1 loopend sub 20210311
汇率兑换计算器

类似问答
  • 求实时股票数据接口,c++例程,要求消息驱动。
    • 2024-12-01 10:59:27
    • 提问者: 未知
    问问大智慧的工程师
  • 想在网上做兼职赚零花钱,不要求多,一天30左右就可以了。有靠谱的吗?求介绍
    • 2024-12-01 15:58:29
    • 提问者: 未知
    这个行业骗子是很多,但也不能否认了正规**,不能因为一次被人骗,就说人人都是骗子。我们应该互相尊重,没有真凭实据之前,不要轻易把骗子二字说出来。人都伤不起的!要...
  • 紧急求教!!!
    • 2024-12-01 03:19:25
    • 提问者: 未知
    重新用农行账户开户填写的**号码办理基金开户手续!再进入网上交易才可以!(基金开户填写的**号码不能修改的)
  • 求作文,750左右,要有精彩开头结尾,谢谢,急!
    • 2024-12-01 01:57:26
    • 提问者: 未知
    和谐之美 那美丽的鲜花,因为有了绿叶的依偎,才显得清纯和鲜润;那蓝蓝的天空,因为有了白云的打扫,才显得静穆和安详;那宽广的大地,因为有了万物的拥吻,才显得和平和馨香.而一个人,一个家庭,一个社会,甚至一个**,不也是因为互相依存,互相映衬,互相促进,一起共同发展,才呈现出那五彩斑斓的和谐吗?和谐...
  • 卧室吊顶照明设计有什么要求?
    • 2024-12-01 03:47:16
    • 提问者: 未知
    卧室吊顶的照明是非常重要的卧室装修设计的主体部分。主卧室出发点是总体照明的主要源。它应该是中性的且令人放松的,并通过使用一个以上的照明点而最好地得以实现。然后考虑实际的照明需要:...
  • 紧急求助!
    • 2024-12-01 15:38:05
    • 提问者: 未知
    这个事情,可以是几个股东进行商议的,就是说,其他股东认可你的专利入股价值,但在企业章程里,技术入股不能超过注册资金的30%。一旦确定了你的专利价值,其他股东的持股比例就能算出来了。例如你的专利确定为20万元,你的比例就是20÷(80+50+20+10)=12.5%。补充回答:《公司法》第二十四条第二款规定:以工业产权、非专利技术作价出资的金额不得超过有限公司注册资本的百分之二十,**对采用高新技术...
  • 跪求法律实习日记!紧急!!
    • 2024-12-01 20:34:32
    • 提问者: 未知
    今天,我去帮人打官司了。我觉得是潮险人有错,**人没错。
  • 国际金融实务计算题 紧急求助!!!
    • 2024-12-01 04:47:59
    • 提问者: 未知
    1题不是特别sure,2题你题目没给完吧,就给你做做3,4题吧 3.存在,你先在纽约花1usd买入1.8972dem,然后在法兰克福买入1.8972/3.7826=0.50156gbp,最后在伦敦卖出手中的gbp买入usd,得到0.50156*2.1139=1.060247206u**,套利0.060247206 你的本金是120w美元,那就可以套利72296.65元 4.用乙分别减去甲...
  • 紧急求助
    • 2024-12-01 10:05:21
    • 提问者: 未知
    给幼猫喂奶不要硬灌,用针管一点点的喂,从猫嘴的侧面把针头插进去(不是金属的针头),看到猫咪有吞咽动作后再注入。另外建议你给猫咪买支营养膏,抹在嘴上,它们会自己舔...
  • **银行向英国汇钱手续费要多少?怎么计算?大概要汇1100左右吧。求详细过程
    • 2024-12-01 10:54:27
    • 提问者: 未知
    费用构成如下:  外汇管理局会收一笔电汇费150元人民币,外加手续费大约0.5%,按照美元或者英镑计算。还跟对方收款行手续费有关系,按5英镑估算。  预估合计费用在230人民币。  **外汇管理局是**部委管理的**局,由**人民银行管理,行政级别为副部级。内设9个职能司和机关党委,设置4个事业单位。在各省、自治区、直辖市、部分副省级城市设立36个分局(其中2个外汇管理部),在部分地(市)设立30...
汇率兑换计算器

热门推荐
热门问答
最新问答
推荐问答
新手帮助
常见问题
房贷计算器-九子财经 | 备案号: 桂ICP备19010581号-1 商务联系 企鹅:2790-680461

特别声明:本网为公益网站,人人都可发布,所有内容为会员自行上传发布",本站不承担任何法律责任,如内容有该作者著作权或违规内容,请联系我们清空删除。