delphi中用savedialog保存文件

我现在要将一个图片路径保存下来,并存于一个表中,每次运行时image从表中寻找路径,我使用的是savedialog,写的代码如下: if savedialog1.Execute then begin image1.Picture.SaveToFile(SaveDialog1.FileName+✀.bmp✀); adoquery1.Edit; dbedit1.Text:=savedialog1.FileName; adoquery1.Post; end;这样的话表格会显示:E:尀pic如果我将整个工程拷至另外一个电脑的F盘,路径就无法找到。怎样让它保存的是一个相对路径,然后每次运行查找时找这个工程的安装文件夹里的pic文件。还有一个问题,我使用pagcontrol,需要其中的tabsheet进行自动跳转。每个tabsheet中都有一个选择题,当radiobutton被选中后就跳至下一页。代码是:procedure TForm1.RadioButton1Click(Sender: TObject);begin PageControl1.activePage:= TabSheet2;end;procedure TForm1.RadioButton2Click(Sender: TObject);begin PageControl1.activePage:= TabSheet2;end;这样虽然会跳转,但是它是直接跳到最后一页。我所有的radiobutton的check属性设为false.
2026年09月25日 18:48
有1个网友回答
网友(1):

用这个
ExtractFilePath(Application.ExeName)+savedialog1.FileName

就可以了。

用PageControl1 的paeindex 处理