Le forum (ô combien francophone) des utilisateurs de Powerbuilder.










Salut,
Je ne sais pas comment appeler du code DOTNET avec pb11
exemple
code dotnet : Form1.cs
using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; namespace TestPB { /// <summary> /// </summary> public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.Button button1; private System.Windows.Forms.TextBox textBox1; private System.Windows.Forms.Label label1; /// <summary> /// </summary> private System.ComponentModel.Container components = null; public Form1() { // // Requis pour la prise en charge du Concepteur Windows Forms // InitializeComponent(); // // } /// <summary> /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Code gnr par le Concepteur Windows Form /// <summary> /// </summary> private void InitializeComponent() { this.button1 = new System.Windows.Forms.Button(); this.textBox1 = new System.Windows.Forms.TextBox(); this.label1 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // button1 // this.button1.Location = new System.Drawing.Point(64, 104); this.button1.Name = "button1"; this.button1.TabIndex = 0; this.button1.Text = "Afficher Msg"; this.button1.Click += new System.EventHandler(this.button1_Click); // // textBox1 // this.textBox1.Location = new System.Drawing.Point(8, 64); this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(200, 20); this.textBox1.TabIndex = 1; this.textBox1.Text = ""; // // label1 // this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.label1.Location = new System.Drawing.Point(8, 40); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(192, 23); this.label1.TabIndex = 2; this.label1.Text = ; // // Form1 // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(216, 150); this.Controls.Add(this.label1); this.Controls.Add(this.textBox1); this.Controls.Add(this.button1); this.Name = "Form1"; this.Text = ; this.ResumeLayout(false); } #endregion /// <summary> /// </summary> [STAThread] static void Main() { Application.Run(new Form1()); } private void button1_Click(object sender, System.EventArgs e) { if (textBox1.Text == string.Empty) textBox1.Text = "Aucun message"; MessageBox.Show(textBox1.Text); } } }
sur le clique d'un bouton j'aimerai faire un truc du style
#if defined PBDOTNET then using XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX; Form1.Main(); #end if
qqu'un sait comment faire ?
Hors ligne










J'ai un probleme pour faire un deploy de l'appli en winform sur des item de menu meme avec le code en commentaire
J'attends une reponse de nos amis de sybase avant de supprimer ces items
De plus il m'a été repondu que "Le code .net doit etre non visuel"
Hors ligne