掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
コントロール"は親ウィンドウを持っていませんというエラーを止めるには? (ID:29516)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
>>ofZさん 返信ありがとうございます。 試してみましたがやっぱり同じエラーが出てしまいました。 >>KHE00221さん はい、おっしゃる通り投稿用に少し書きなおしました>< もう少し元ソースっぽくするとこうなります。 procedure TFishEyeView.FormActivate(Sender: TObject); var MaxLength,I,J,K:integer; function Roundoff(x: double): integer; begin if x>=0 then Result:=Trunc(x+0.5) else Result:=Trunc(x-0.5); end; begin FilesCount:=100; if not(FilesCount=0) then begin MaxLength:=0; for I:=1 to FilesCount do if MainPage.WindowsMediaPlayer.URL=RemoteController.FilesListView.Items[I-1].Caption then CurrentPositionTime[I]:=MainPage.WindowsMediaPlayer.Controls.CurrentPosition; for I:=1 to FilesCount do if MaxLength<Roundoff(CurrentPositionTime[I]) then MaxLength:=Roundoff(CurrentPositionTime[I]); for I:=1 to FilesCount do begin if Assigned(FOwnerDrawButton[I]) then FreeAndNil(FOwnerDrawButton[I]); if CurrentPositionTime[I]>=60 then begin if Assigned(FOwnerDrawButton[I])=False then begin FOwnerDrawButton[I]:=TOwnerDrawButton.Create(self); FOwnerDrawButton[I].Parent:=FishEyeView; FOwnerDrawButton[I].Font.Size:=12; FOwnerDrawButton[I].Caption:=IntToStr(I); end; FOwnerDrawButton[I].Height:=34; FOwnerDrawButton[I].Width:=34; Randomize; n:=Random(4); case n of 0: begin Yaxis[I]:=Roundoff(CurrentPositionTime[I])*(ClientHeight div 2) div MaxLength; for J:=0 to 9 do if (J*ClientHeight div 20<=Yaxis[I]) and (Yaxis[I]<=(J+1)*ClientHeight div 20) then begin FOwnerDrawButton[I].Height:=FOwnerDrawButton[I].Height+J*5; FOwnerDrawButton[I].Width:=FOwnerDrawButton[I].Width+J*5; end; for J:=1 to FilesCount do for K:=0 to 9 do if Yaxis[J]>=((ClientHeight*K) div 20) then Xaxis[J]:=((ClientWidth*K) div 20)+Random(((ClientWidth*(20-K*2)) div 20)+1); end; 1: begin Xaxis[I]:=Roundoff(CurrentPositionTime[I])*(ClientWidth div 2) div MaxLength; for J:=0 to 9 do if (J*ClientWidth div 20<=Xaxis[I]) and (Xaxis[I]<=(J+1)*ClientWidth div 20) then begin FOwnerDrawButton[I].Height:=FOwnerDrawButton[I].Height+J*5; FOwnerDrawButton[I].Width:=FOwnerDrawButton[I].Width+J*5; end; for J:=1 to FilesCount do for K:=0 to 9 do if Xaxis[J]>=((ClientWidth*K) div 20) then Yaxis[J]:=((ClientHeight*K) div 20)+Random(((ClientHeight*(20-K*2)) div 20)+1); end; 2: begin Yaxis[I]:=abs((Roundoff(CurrentPositionTime[I])*(ClientHeight div 2) div MaxLength)-ClientHeight); for J:=10 to 19 do if (J*ClientHeight div 20<=Yaxis[I]) and (Yaxis[I]<=(J+1)*ClientHeight div 20) then begin FOwnerDrawButton[I].Height:=FOwnerDrawButton[I].Height+(19-J)*5; FOwnerDrawButton[I].Width:=FOwnerDrawButton[I].Width+(19-J)*5; end; for J:=1 to FilesCount do for K:=10 to 19 do if Yaxis[J]>=(ClientHeight*K) div 20 then Xaxis[J]:=((ClientWidth*(19-K)) div 20)+Random(((ClientWidth*(20-(19-K)*2)) div 20)+1); end; 3: begin Xaxis[I]:=abs((Roundoff(CurrentPositionTime[I])*(ClientWidth div 2) div MaxLength)-ClientWidth); for J:=10 to 19 do if (J*ClientWidth div 20<=Xaxis[I]) and (Xaxis[I]<=(J+1)*ClientWidth div 20) then begin FOwnerDrawButton[I].Height:=FOwnerDrawButton[I].Height+(19-J)*5; FOwnerDrawButton[I].Width:=FOwnerDrawButton[I].Width+(19-J)*5; end; for J:=1 to FilesCount do for K:=10 to 19 do if Xaxis[J]>=((ClientWidth*K) div 20) then Yaxis[J]:=((ClientHeight*(19-K)) div 20)+Random(((ClientHeight*(20-(19-K)*2)) div 20)+1); end; end; FOwnerDrawButton[I].Left:=Xaxis[I]-FOwnerDrawButton[I].Width; if Xaxis[I]-FOwnerDrawButton[I].Width<0 then FOwnerDrawButton[I].Left:=Xaxis[I]; FOwnerDrawButton[I].Top:=Yaxis[I]-FOwnerDrawButton[I].Height; if Yaxis[I]-FOwnerDrawButton[I].Height<0 then FOwnerDrawButton[I].Top:=Yaxis[I]; end; end; end; end;
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.