Jump to content
Xtreme .Net Talk

JDogg

Members
  • Posts

    12
  • Joined

  • Last visited

JDogg's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Here's the layout properties and their values... I can't see why any of them would make this happen: AutoScale: true AutoScroll: false AutoScrollMargin: 0,0 AutoScrollMinSize: 0,0 DockPadding: All: 0 Left: 0 Top: 0 Right: 0 Bottom: 0 Location: 0,0 MaximumSize: 0,0 MinimumSize: 0,0 Size: 272, 152 StartPosition: WindowsDefault WindowState: Normal I've tried setting AutoScale to both true and false, and neither changes this. This is the wierdest thing, I've tried everything. This is killing me.
  2. Nope... in fact this is all the code in the form: ption Strict Off Option Explicit On Friend Class frmAbout Inherits System.Windows.Forms.Form #Region "Windows Form Designer generated code " Public Sub New() MyBase.New() If m_vb6FormDefInstance Is Nothing Then If m_InitializingDefInstance Then m_vb6FormDefInstance = Me Else Try 'For the start-up form, the first instance created is the default instance. If System.Reflection.Assembly.GetExecutingAssembly.EntryPoint.DeclaringType Is Me.GetType Then m_vb6FormDefInstance = Me End If Catch End Try End If End If 'This call is required by the Windows Form Designer. InitializeComponent() 'This form is an MDI child. 'This code simulates the VB6 ' functionality of automatically ' loading and showing an MDI ' child's parent. Me.MDIParent = DairyPredictor.frmMDI.DefInstance.DefInstance DairyPredictor.frmMDI.DefInstance.DefInstance.Show 'The MDI form in the VB6 project had its 'AutoShowChildren property set to True 'To simulate the VB6 behavior, we need to 'automatically Show the form whenever it 'is loaded. If you do not want this behavior 'then delete the following line of code 'UPGRADE_NOTE: Remove the next line of code to stop form from automatically showing. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup2018"' Me.Show End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal Disposing As Boolean) If Disposing Then If Not components Is Nothing Then components.Dispose() End If End If MyBase.Dispose(Disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer Public ToolTip1 As System.Windows.Forms.ToolTip Public WithEvents tmrHelpPause As System.Windows.Forms.Timer Public WithEvents imgCow As System.Windows.Forms.PictureBox Public WithEvents cmdOK As System.Windows.Forms.Button Public WithEvents lblDescription As System.Windows.Forms.Label Public WithEvents lblTitle As System.Windows.Forms.Label Public WithEvents Line1 As Microsoft.VisualBasic.Compatibility.VB6.LabelArray 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmAbout)) Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components) Me.tmrHelpPause = New System.Windows.Forms.Timer(Me.components) Me.imgCow = New System.Windows.Forms.PictureBox Me.cmdOK = New System.Windows.Forms.Button Me.lblDescription = New System.Windows.Forms.Label Me.lblTitle = New System.Windows.Forms.Label Me.Line1 = New Microsoft.VisualBasic.Compatibility.VB6.LabelArray(Me.components) CType(Me.Line1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'tmrHelpPause ' Me.tmrHelpPause.Enabled = True Me.tmrHelpPause.Interval = 10000 ' 'imgCow ' Me.imgCow.BackColor = System.Drawing.SystemColors.Control Me.imgCow.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D Me.imgCow.Cursor = System.Windows.Forms.Cursors.Default Me.imgCow.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.imgCow.ForeColor = System.Drawing.SystemColors.ControlText Me.imgCow.Image = CType(resources.GetObject("imgCow.Image"), System.Drawing.Image) Me.imgCow.Location = New System.Drawing.Point(8, 8) Me.imgCow.Name = "imgCow" Me.imgCow.RightToLeft = System.Windows.Forms.RightToLeft.No Me.imgCow.Size = New System.Drawing.Size(41, 41) Me.imgCow.TabIndex = 3 ' 'cmdOK ' Me.cmdOK.BackColor = System.Drawing.SystemColors.Control Me.cmdOK.Cursor = System.Windows.Forms.Cursors.Default Me.cmdOK.DialogResult = System.Windows.Forms.DialogResult.Cancel Me.cmdOK.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.cmdOK.ForeColor = System.Drawing.SystemColors.ControlText Me.cmdOK.Location = New System.Drawing.Point(96, 96) Me.cmdOK.Name = "cmdOK" Me.cmdOK.RightToLeft = System.Windows.Forms.RightToLeft.No Me.cmdOK.Size = New System.Drawing.Size(76, 23) Me.cmdOK.TabIndex = 0 Me.cmdOK.Text = "OK" ' 'lblDescription ' Me.lblDescription.BackColor = System.Drawing.SystemColors.Control Me.lblDescription.Cursor = System.Windows.Forms.Cursors.Default Me.lblDescription.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.lblDescription.ForeColor = System.Drawing.Color.Black Me.lblDescription.Location = New System.Drawing.Point(16, 64) Me.lblDescription.Name = "lblDescription" Me.lblDescription.RightToLeft = System.Windows.Forms.RightToLeft.No Me.lblDescription.Size = New System.Drawing.Size(248, 14) Me.lblDescription.TabIndex = 1 Me.lblDescription.Text = "Created by Matthew McMahon and Justin Poirier" ' 'lblTitle ' Me.lblTitle.BackColor = System.Drawing.SystemColors.Control Me.lblTitle.Cursor = System.Windows.Forms.Cursors.Default Me.lblTitle.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.lblTitle.ForeColor = System.Drawing.Color.Black Me.lblTitle.Location = New System.Drawing.Point(64, 16) Me.lblTitle.Name = "lblTitle" Me.lblTitle.RightToLeft = System.Windows.Forms.RightToLeft.No Me.lblTitle.Size = New System.Drawing.Size(112, 32) Me.lblTitle.TabIndex = 2 Me.lblTitle.Text = "Dairy Predictorv1.0" ' 'frmAbout ' Me.AcceptButton = Me.cmdOK Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.BackColor = System.Drawing.SystemColors.Control Me.CancelButton = Me.cmdOK Me.ClientSize = New System.Drawing.Size(266, 127) Me.Controls.Add(Me.imgCow) Me.Controls.Add(Me.cmdOK) Me.Controls.Add(Me.lblDescription) Me.Controls.Add(Me.lblTitle) Me.Cursor = System.Windows.Forms.Cursors.Default Me.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) Me.Location = New System.Drawing.Point(361, 220) Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "frmAbout" Me.RightToLeft = System.Windows.Forms.RightToLeft.No Me.ShowInTaskbar = False Me.StartPosition = System.Windows.Forms.FormStartPosition.WindowsDefaultBounds Me.Text = "Dairy Predictor" CType(Me.Line1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub #End Region #Region "Upgrade Support " Private Shared m_vb6FormDefInstance As frmAbout Private Shared m_InitializingDefInstance As Boolean Public Shared Property DefInstance() As frmAbout Get If m_vb6FormDefInstance Is Nothing OrElse m_vb6FormDefInstance.IsDisposed Then m_InitializingDefInstance = True m_vb6FormDefInstance = New frmAbout() m_InitializingDefInstance = False End If DefInstance = m_vb6FormDefInstance End Get Set m_vb6FormDefInstance = Value End Set End Property #End Region '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''' '''''''''' ''''''''' This form is just the "About" window accessed from the File menu '''''''''' ''''''''' '''''''''' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Private Sub cmdOK_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdOK.Click Me.Close() End Sub Private Sub frmAbout_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load Me.Text = "About Dairy Predictor v 1.0" lblTitle.Text = "Dairy Predictor v 1.0" End Sub Private Sub Timer1_Timer() Me.Close() End Sub End Class
  3. Hi. In my VB .NET program I have a form that's size property is set to 270, 150, but since I upgraded my program from 6.0 it shows up really big at runtime--3/4 the size of the screen. The size property is still set to 270 X 150, and in the .NET design environment it looks right. What more is there to setting the size of a form? Thanks.
  4. I already declare my Excel-related objects exactly like you suggested (but without the brackets): Dim Excel As Excel.Application Dim excelwbk As Excel.Workbook Dim excelws As Excel.Worksheet I don't use Interop in my declarations. But the article http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q301/9/82.ASP&NoWebContent=1 says to put Imports Microsoft.Office.Interop at the top of forms that automate Excel. That's the line that gives me the error. Do I not need it? Thanks.
  5. Hi. My program creates an Excel document, so i import Microsoft.Office.Interop. I get the error "Namespace or type 'Interop' for the imports 'Microsoft.Office.Interop' cannot be found" in my task list. Can anyone tell me why? This may be a simple issue, but I'm new to using Excel in VB... everything I know I learned from some MSDN article. It said I also had to add a reference to "Microsoft Excel Object Library", but when I went to do that I had to choose between version 5.0 and 8.0. I've tried both, and my problem still persists. Thanks in advance.
  6. ya, but then what do I do with it? Say I have it so that the user clicks anywhere to begin using the program... then what? I can't close the intro form, cuz it being the startup form that would make the program end... I could hide it, but then how do I get rid of it when the user closes the program? Won't it be left hanging?
  7. Hi. Can someone tell me how to splash an intro form on the screen at the beginning of my program? Thanks.
  8. Here's my situation: I need to move a button at runtime. I originally wrote the code in VB 6.0, and in order to move the button I just triggered its Move event. Now I need to be able to do that in VB .NET. I'm just learning about events, so I got confused earlier when you were talking about handlers. I want to actually trigger the event, not just respond to it.
  9. I'm starting to see what you mean... I had to read up on exactly what "events" and "handlers" were... :) The thing I don't get now is that the "btn" that I refer to is just an array of buttons placed on frmMsg... so frmMsg just inherits the handlers for the buttons' move events... but these handlers are empty, they don't do anything, ie. they don't appear in the code for frmMsg, only in the drop down menu of methods at the top of the screen, and when I select one it's just an empty sub... u know what I mean?
  10. sorry... I'm pretty new to VB... what do you mean by "class" the sub? Are you recommending something like this: RaiseEvent CType(FMsg.btn(2), Control).Move(ButtonLeft + 2820, ButtonTop) That may be the farthest thing from what you're suggesting; again there's parts of VB I completely don't understand.
  11. But if I take the RaiseEvent away and just call it directly, ie. CType(FMsg, frmMsg).btn(2).Move(ButtonLeft + 2820, ButtonTop) it says in the task list that Move() cannot be called directly, and I should use RaiseEvent. What should I do?
  12. Hi. Can somebody tell me what's wrong with the following line: RaiseEvent CType(FMsg, frmMsg).btn(2).Move VB doesn't like CType's presence, but I can't refer to btn(2) without casting FMsg. I tried putting brackets around all of CType(FMsg, frmMsg).btn(2).Move but VB underlined the opening bracket and said "identifier expected" in the task list. Thanks in advance.
×
×
  • Create New...