我有一个组合框,其样式设置为csDropDown.我试图在OnSelect事件处理程序中执行此操作;
if cboEndTime.ItemIndex > -1 then
cboEndTime.Text := AnsiLeftStr(cboEndTime.Text, 5);
Run Code Online (Sandbox Code Playgroud)
但它没有效果.
组合项看起来像这样;
09:00(0分钟)
09:30(30分钟)
10:00(1小时)
10:30(1.5小时)
......
例如,如果我选择第二项,我希望组合框的文本显示为09:30,即截断.将ItemIndex设置为-1.
我怎么能得到这个?
在firebird中我可以DateAdd在where子句中使用该函数吗?我有以下sql;
select
s.number,
s.warranty_start
from
serial_number s
where
s.warranty_start > dateadd(year, -3, 'now')
Run Code Online (Sandbox Code Playgroud)
我得到错误;
expression evaluation not supported
Run Code Online (Sandbox Code Playgroud) 我有以下代码;
// World
var geometry = new THREE.BoxGeometry( 100, 200, 100 );
var material = new THREE.MeshLambertMaterial( { color: 'green' } );
var cube = new THREE.Mesh( geometry, material );
cube.position.y = (cube.height / 2); // this doesn't work
scene.add( cube );
Run Code Online (Sandbox Code Playgroud)
获得立方体高度的正确方法是什么?我知道身高= 100,但我想知道如何使用程序代码获得高度.
当dgRowSelect = False时,如何检测OnDrawColumnCell方法中的选定行?
不是选定的单元格,而是包含所选单元格的行.
我的数据库中有一个必填字段(NOT NULL),但允许使用空字符串。
我如何获得一个delphi TDataset来使用它?将字段对象的required属性设置为true或false时,它似乎仍试图存储null而不是空字符串。
有关信息,请使用TIBDataset和TIBStringField。
我从传统的Delphi 2010应用程序中获取此代码.
var InternalServices: TThemeServices;
function ThemeServices: TThemeServices;
begin
if InternalServices = nil then
InternalServices := ThemeServicesClass.Create;
Result := InternalServices;
end;
Run Code Online (Sandbox Code Playgroud)
编译器告诉我ThemeServicesClass.Create不存在.我应该如何在Delphi XE8中执行此操作?
我的班级看起来像这样;
type TBatchFilter = class(TObject)
private
FBatchNo: string;
FLine: string;
FCutoffDate: TDate;
public
constructor Create(ABatchNo, ALine: string; ACutoffDate: TDate); overload;
constructor Create(ABatchFilter: TBatchFilter); overload;
property BatchNo: string read FBatchNo;
property Line: string read FLine;
property CutoffDate: TDate read FCutoffDate;
end;
Run Code Online (Sandbox Code Playgroud)
我想让ACutoffDate:TDate参数可选.我是这样调用构造函数的东西;
MyBatchFilter := TBatchFilter('BATCH1', 'LINE1', nil);
Run Code Online (Sandbox Code Playgroud)
然后在构造函数中有这样的东西;
if (ACuttoffDate = nil) then
dosomething
else
dosomethingelse;
Run Code Online (Sandbox Code Playgroud)
但我不能将nil作为参数传递.我真的不想进一步重载构造函数.
delphi ×5
combobox ×1
delphi-xe8 ×1
firebird ×1
firebird2.5 ×1
parameters ×1
sql ×1
tdataset ×1
tdbgrid ×1
three.js ×1