Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Основная";
Текущий архив: 2004.09.12;
Скачать: [xml.tar.bz2];

Вниз

Delphi 8 - как скрыть форму?   Найти похожие ветки 

 
Nikk   (2004-08-15 19:10) [0]

Может кто-нибудь подсказать, как в 8-рке скрыть форму?  куда делось свойство visible???

Заранее всем спасибо!


 
jack128 ©   (2004-08-15 19:20) [1]

какая форма? Вообще не думаю, чтоб в TForm убрали свойство Visible, да и в Forms.Form это свойство присутствует. Так что ищи лудше ;-)


 
jack128 ©   (2004-08-15 19:22) [2]

Опять же методы Close есть и в той и в другой форме.


 
Nikk   (2004-08-15 19:42) [3]

8-ку только поставил, и не могу понять где там visible, ты в 8-ой работал? тогда можно реальный пример, как из одной формы сделать хотя бы по нажатии кнопки видимой другю форму?
Не могу вьехать :( раньше работал в 5-рке там все понятно а тут по другому!


 
jack128 ©   (2004-08-15 20:26) [4]

Для начала у тя какой проэкт создан? VCL или Windows.Forms ?


 
46_55_41_44 ©   (2004-08-16 08:58) [5]

Тебе нужно FormStyle установить fsNormal...
А потом в коде даешь Form1.Hide
Если у тебя форма MDIChild, то никак!!!


 
YurikGL ©   (2004-08-16 09:12) [6]

Ставь обратно делфи7


 
Nikk   (2004-08-16 14:59) [7]

Я блин сам дурак, запускал Windows Forms Applicaition вместо VCL Forms Applicaition  - тут все свойства есть! Не понятно почему в Windows Forms Applicaition - все так урезано.. хотя книжку пока не читал по 8-ке..

jack128 а чем эти два проекта отличаються то?
 

Всем спасибо!


 
jack128 ©   (2004-08-16 15:37) [8]

VCL Forms Application использует VCL.NET как в общем то ясно из названия ;-) Windows Forms использует родные для NET формы из пространства имен Windows.Forms  Кстати меня гложут сильные сомнения о необходимости использовать VCL Forms Application в новых проэктах.. Хотя это наду смотреть - я с Delphi8 и .NET не работал..


> Не понятно почему в Windows Forms Applicaition - все так
> урезано
все там есть..Ищи лудше ;-)


 
Nikk   (2004-08-17 16:43) [9]

jack128 да нету! :)
ведь ладно нету в панели где св-ва объекта.. но когда пишешь имя и потом ставишь точку.. form1.  то? должен расскрываться список со свойствами так? и в этом списке не visible не hide не show..  :( втрятли их откуда-то нужно добавлять.. это же в дельфях всегда было стандартно...


 
jack128 ©   (2004-08-17 16:58) [10]

Из .NET Framework SDK

Control.Visible Property  [C#]See Also
Control Class | Control Members | System.Windows.Forms Namespace | Enabled | CanFocus | Hide | SetVisibleCore | Control Members (Visual J# Syntax) | Managed Extensions for C++ Programming
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework - Windows CE .NET
Language
C#

C++

JScript

Visual Basic

Show All
Gets or sets a value indicating whether the control is displayed.

[Visual Basic]
Public Property Visible As Boolean

[C#]
public bool Visible {get; set;}

[C++]
public: __property bool get_Visible();
public: __property void set_Visible(bool);

[JScript]
public function get Visible() : Boolean;
public function set Visible(Boolean);

Property Value
true if the control is displayed; otherwise, false. The default is true.

Form.Close Method  [C#]See Also
Form Class | Form Members | System.Windows.Forms Namespace | Cancel | Closing | Form Members (Visual J# Syntax) | Managed Extensions for C++ Programming
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework - Windows CE .NET
Language
C#

C++

JScript

Visual Basic

Show All
Closes the form.

[Visual Basic]
Public Sub Close()

[C#]
public void Close();

[C++]
public: void Close();

[JScript]
public function Close();

Exceptions
Exception Type Condition
InvalidOperationException The form was closed while a handle was being created.

Remarks
When a form is closed, all resources created within the object are closed and the form is disposed. You can prevent the closing of a form at run time by handling the Closing event and setting the Cancel property of the CancelEventArgs passed as a parameter to your event-handling method. If the form you are closing is the startup form of your application, your application ends.

Note   When the Close method is called on a Form displayed as a modeless window, you cannot call the Show method to make the form visible, because the form"s resources have already been released. To hide a form and then make it visible, use the Control.Hide method.
CAUTION   The Form.Closed and Form.Closing events are not raised when the Application.Exit method is called to exit your application. If you have validation code in either of these events that must be executed, you should call the Form.Close method for each open form individually before calling the Exit method.
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework - Windows CE .NET

Control.Hide Method  [C#]See Also
Control Class | Control Members | System.Windows.Forms Namespace | Visible | Show | Control Members (Visual J# Syntax) | Managed Extensions for C++ Programming
Requirements
Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework - Windows CE .NET
Language
C#

C++

JScript

Visual Basic

Show All
Conceals the control from the user.

[Visual Basic]
Public Sub Hide()

[C#]
public void Hide();

[C++]
public: void Hide();

[JScript]
public function Hide();

Remarks
Hiding the control is equivalent to setting the Visible property to false. After the Hide method is called, the Visible property returns a value of false until the Show method is called.

Example
[Visual Basic, C#, C++] The following example hides a button when the CTRL key is pressed while the button is clicked. This example assumes you have a Button named button1 on a Form.

[Visual Basic]
Private Sub button1_Click(sender As Object, _
 e As EventArgs) Handles button1.Click
  " If the CTRL key is pressed when the
  " control is clicked, hide the control.
  If Control.ModifierKeys = Keys.Control Then
     CType(sender, Control).Hide()
  End If
End Sub

[C#]
private void button1_Click(object sender, System.EventArgs e)
{
  /* If the CTRL key is pressed when the
     * control is clicked, hide the control. */
  if(Control.ModifierKeys == Keys.Control)
  {
     ((Control)sender).Hide();
  }
}


 
jack128 ©   (2004-08-17 17:11) [11]

Вот. На Шарпе все работает, значит и на дельфе должно..
using System;
using System.Threading;
using System.Windows.Forms;

class MyForm: Form
{
protected override void OnClick(EventArgs e)
{
 this.Visible = false;
 Thread.Sleep(1000);
 this.Visible = true;
}

}

class MyCoolApp
{
public static void Main()
{
 Application.Run(new MyForm());
}
}


 
Александр1   (2004-08-17 19:50) [12]

Nikk - Ну если этот delphi 8 такой плохой, то нафига он тебе нужен?


 
Beer   (2004-08-24 15:27) [13]

Да ни фига он не плохой. Глаза открыть только надо. Есть в восьмой Дельфе свойство Visible, как в VCL Forms, так и в Windows Forms.



Страницы: 1 вся ветка

Форум: "Основная";
Текущий архив: 2004.09.12;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.49 MB
Время: 0.036 c
1-1093422580
happyandry
2004-08-25 12:29
2004.09.12
Дельфи - > Excel (свойства ячеек)


14-1093256734
Slider007
2004-08-23 14:25
2004.09.12
Shift+Insert


8-1087910010
Chery
2004-06-22 17:13
2004.09.12
MediaPlayer. Как развернуть файл во весь экран?


3-1092727581
REA
2004-08-17 11:26
2004.09.12
Добавление detail данных


3-1092740928
Aleksandr.
2004-08-17 15:08
2004.09.12
Ошибка "Insufficient memory for this operation."





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский