国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

托拽Explore中的文件到VB.net的窗口 40Star(原作)

2024-07-10 13:08:02
字體:
來源:轉載
供稿:網友
托拽explore中的文件到vb.net的窗口    40star(原作)  
  
關鍵字     wm_dropfiles vb.net
  


要讓vb.net相應外部托拽來的文件,需處理wm_dropfiles消息。

private declare sub dragacceptfiles lib "shell32.dll" (byval hwnd as int32, byval faccept as int32)
private declare sub dragfinish lib "shell32.dll" (byval hdrop as int32)
private declare function dragqueryfile lib "shell32.dll" alias "dragqueryfilea" (byval hdrop as int32, byval uint as int32, byval lpstr as

string, byval ch as int32) as int32

private const wm_dropfiles = &h233
private const max_length = 255

protected overrides sub wndproc(byref m as system.windows.forms.message)
    if m.msg = wm_dropfiles then
        dragfiles(m.wparam.toint32)
        exit sub
    end if
    mybase.wndproc(m)
end sub

private sub dragfiles(byval hdrop as int32)
    dim ireturn as int32
    dim sfile as string
    sfile = space(max_length)
    ireturn = dragqueryfile(hdrop, 0, sfile, max_length)
    if ireturn then
        textbox3.text = sfile
        picturebox1.image = image.fromfile(trim(textbox3.text))
        dragfinish(hdrop)
    end if
end sub

我的代碼只是適用于.net的picturebox能用的圖像文件噢!





發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 若羌县| 昭苏县| 搜索| 永康市| 兴安县| 麻栗坡县| 积石山| 阜宁县| 沂南县| 都匀市| 都兰县| 临猗县| 庆安县| 阿瓦提县| 清徐县| 佳木斯市| 高阳县| 炎陵县| 宁安市| 贵德县| 鹰潭市| 金塔县| 洪洞县| 南丹县| 金秀| 进贤县| 托里县| 镇巴县| 呼图壁县| 西宁市| 绥棱县| 南投县| 灵山县| 鄂州市| 沙雅县| 肥西县| 甘孜县| 扶沟县| 五峰| 大城县| 永善县|