這里以我的軟件“文章管理系統”為例解釋一下ole拖放在vb中的應用: 在窗體中添加一個image控件,在它的imgdrop_oledragdrop過程中添加如下代碼: private sub imgdrop_oledragdrop(data as dataobject, effect as long, button as integer, shift as integer, x as single, y as single) dim strtmp
if data.getformat(15) then dim strfilename as string strfilename = getfilename(data.files(1)) ............ end if
if data.getformat(1) then dim strcontent as string strcontent=data.getdata(1) ................. end if end sub