Skip to forum content
My Visual Database
A Simple Solution for Creating Databases
You are not logged in. Please login or register.
Active topics Unanswered topics
Search options (Page 131 of 400)
Topics by DriveSoft User defined search
Posts found: 3,251 to 3,275 of 9,999
К сожалению получить дату файла нет возможности. Почему бы просто не разместить текстовый файл с номером версии и проверять его содержимое?
Но обычно проверку на наличие новой версии делается через Интернет. На сайт выкладываете текстовый файл, в кором написан номер версии, затем с помощью функции HTTPGet получаете содержимое этого файла и сравниваете.
Own icons for buttons
var
ImageList: TImageList;
begin
// create new ImageList
ImageList:=TImageList.Create(Form1);
ImageList.Masked:=false;
ImageList.ColorDepth:=cd32bit;
// size of images
ImageList.Width := 16;
ImageList.Height := 16;
// load images
ImageList.AddPng(ExtractFilePath(Application.ExeName)+'Icons\key.png'); // 0 - index if image
ImageList.AddPng(ExtractFilePath(Application.ExeName)+'Icons\accept.png'); // 1
ImageList.AddPng(ExtractFilePath(Application.ExeName)+'Icons\link.png'); // 2
ImageList.AddPng(ExtractFilePath(Application.ExeName)+'Icons\window.png'); // 3
// Change ImageList for buttons
Form1.Button1.Images := ImageList;
Form1.Button2.Images := ImageList;
Form1.Button3.Images := ImageList;
Form1.Button4.Images := ImageList;
Form1.Button5.Images := ImageList;
Form1.Button6.Images := ImageList;
// Select images for buttons
Form1.Button1.ImageIndex := 0;
Form1.Button2.ImageIndex := 1;
Form1.Button3.ImageIndex := 2;
Form1.Button4.ImageIndex := 3;
Form1.Button5.ImageIndex := 3;
Form1.Button6.ImageIndex := 3;
end.
Project example:
1. Создать меню можно и в секции begin end. которая расположена в самом конце скрипта, т.о. избежав использование события OnShow, пример
var
MyItem1: TMenuItem;
MyItem2: TMenuItem;
MySubItem3: TMenuItem;
procedure MenuClick1 (Sender: string);
begin
ShowMessage('Hello from MyItem1');
end;
procedure MenuClick3 (Sender: string);
begin
ShowMessage('Hello from subitem');
end;
begin
MyItem1 := TMenuItem.Create (Form1.MainMenu);
MyItem1.Caption := 'Item1';
MyItem1.OnClick := @MenuClick1;
MyItem2 := TMenuItem.Create (Form1.MainMenu);
MyItem2.Caption := 'Item2';
MySubItem3 := TMenuItem.Create (Form1.MainMenu);
MySubItem3.Caption := 'Submenu';
MySubItem3.OnClick := @MenuClick3;
Form1.mniFile.Insert(0, MyItem1);
Form1.MainMenu.Items.Insert(0, MyItem2);
MyItem2.Add(MySubItem3);
end.
2. К сожалению не понял вопроса, расскажите пожалуйста подробней.
3. Добавил такую возможность в последнюю бета версию
https://www.dropbox.com/s/f3j4kfpnttm1o … b.zip?dl=0
Пример: http://myvisualdatabase.com/forum/viewt … ?pid=20913
Загрузка собственных иконок на кнопки
var
ImageList: TImageList;
begin
// создаем компонент ImageList
ImageList:=TImageList.Create(Form1);
ImageList.Masked:=false;
ImageList.ColorDepth:=cd32bit;
// size of images
ImageList.Width := 16;
ImageList.Height := 16;
// загрузка иконов в ImageList
ImageList.AddPng(ExtractFilePath(Application.ExeName)+'Icons\key.png'); // 0 - номер иконки
ImageList.AddPng(ExtractFilePath(Application.ExeName)+'Icons\accept.png'); // 1
ImageList.AddPng(ExtractFilePath(Application.ExeName)+'Icons\link.png'); // 2
ImageList.AddPng(ExtractFilePath(Application.ExeName)+'Icons\window.png'); // 3
// Присваиваем ImageList для кнопок
Form1.Button1.Images := ImageList;
Form1.Button2.Images := ImageList;
Form1.Button3.Images := ImageList;
Form1.Button4.Images := ImageList;
Form1.Button5.Images := ImageList;
Form1.Button6.Images := ImageList;
// Выбираем номер иконки для кнопок
Form1.Button1.ImageIndex := 0;
Form1.Button2.ImageIndex := 1;
Form1.Button3.ImageIndex := 2;
Form1.Button4.ImageIndex := 3;
Form1.Button5.ImageIndex := 3;
Form1.Button6.ImageIndex := 3;
end.
Проект с примером:
Прошу прощения за задержку с ответом.
Так можно задать самостоятельно позицию окна просмотра изображения
procedure Form2_DBImage1_OnClick (Sender: string);
begin
frmdbCoreImageViewer.Position := poDesigned;
frmdbCoreImageViewer.Top := 0;
frmdbCoreImageViewer.Left := 0;
end;
Здравствуйте.
Прощу прощения за задержку с ответом, был в отпуске. Вопрос все еще актуален для Вас?
Пример
procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
begin
Form1.Edit1.Clear;
Form1.ComboBox1.dbItemID := -1;
Form1.DateTimePicker1.Checked := False;
end;
Все правильно, по другому и не сделать.
Здравствуйте.
Приложите пожалуйста ваш проект (zip файл без exe и dll), также опишите на какой форме это происходит.
К сожалению нет возможности использовать пользовательные функции в SQL запросах.
Вы можете с помощью цикла пройтись по всем записям друг за другом для их преобразования.
Здравствуйте.
Прощу прощения за задержку с ответом, был в отпуске. Вопрос все еще актуален для Вас?
Здравствуйте.
Прощу прощения за задержку с ответом, был в отпуске. Вопрос все еще актуален для Вас?
Please provide more details with a example.
Hello.
The function RemoveDir removes only empty folder, if you want remove all files and sub folders, you can use this script:
function DeleteDirWithFiles(dir: string): boolean;
var
sl: TStringList;
i,c: integer;
begin
result := True;
sl := TStringList.Create;
sl.Text := GetFilesList(dir);
// delete all files
c := sl.Count-1;
for i := 0 to c do
if not DeleteFile(sl[i]) then
begin
ShowMessage('Can''t remove file '+sl[i]);
result := False;
end;
// delete directiries
sl.Text := GetDirectories(dir);
c := sl.Count-1;
for i := c downto 0 do
if not RemoveDir(sl[i]) then
begin
ShowMessage('Can''t remove dirercory '+sl[i]);
result := False;
end;
// delete main directory
RemoveDir(dir);
sl.Free;
end;
// how to use function DeleteDirWithFiles
procedure Form1_Button4_OnClick (Sender: string; var Cancel: boolean);
var
sDir: string;
begin
sDir := 'd:\folder';
if not DeleteDirWithFiles(sDir) then
ShowMessage('Can''t remove directory');
end;
Hello.
Your project placed in the folder "F:\Application\Bases\Fleurs sauvages\tmp" ?
Can you also attach your project and screenshot of error message.
Hello.
Sorry for delay.
An example for you:
Sorry for delay, I was on vacation. The question still actual for you?
Also please provide more details about your question.
Извиняюсь за задержку с ответом, был в отпуске.
Вопрос все еще актуален для вас?
Bolat
Думаю грид с типами двигателей на форме frm_WS_FLEET не нужен. Сделал небольшой скрипт, чтобы показывалось двигатель и его тип.
Также на форму Form1 добавил кнопку "Наработка", где можете ввести рейс, дату и наработку двигателя.
You can remove file script.pas to protect your script against changes by users, for works your project enough file script.dcu
Hello.
If a picture saved in database, you don't need any script to display it in the report.
Please attach your project.
Hello.
CompressDirectory('d:\folder', 'd:\file.zlib');
DecompressFiles('d:\file.zlib', 'd:\');
You can create a shortcut for GetShot.exe file and set properties of shortcut to run file in minimized mode.
OpenFile('/delay '+k+' /width '+i+' /height '+j+' /bmp','GetShot.lnk');
Posts found: 3,251 to 3,275 of 9,999