Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
H

Henry Venn

@Henry Venn
About
Posts
10
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Chelsea 1-2 Tottenham
    H Henry Venn

    Go Reds!

    The Lounge com announcement

  • Emerging technologies/trends in .Net
    H Henry Venn

    I've done an undergrad and then a Masters both in IT (a decade between) and I reckon you could pick a strong emerging technology such as what I am hoping to do - VSTO. I am working on my second Word add-in well its not an add-in this time because the server needs to run with no office installed - you get the drift, I need to LEARN HEAPS about a particular area within .NET and although it limits the job options, having strong skills in that area (or whatever...MS robotics studio maybe?) will mean that you should always be employable! All the best H.

    D'Whizz! . . . . . <--=_~.|-|./^\.\/.~_=--> . . . . . ******************************************* for (Dwiz->isWorkin; time < 5:30 PM; Fun++) { // ... if (u.LOVE == PROGRAMMING) time.Flies; // ! }

    Work Issues csharp question

  • Loading a User Control onto a panel at runtime
    H Henry Venn

    Er...no I didn't. It worked in the test project, but the real application has a regular panel placed inside a flow layout panel, and it doesn't throw an error.... ....10 minutes later.... panelFlowLeft.Controls.Item("panelRight").Controls.Add(myUC) That works. The confusion was the flow layout control - the panel could not be referenced as an item of the main form, because it was 3 levels deep. Pretty simple huh? Well - its all learning, and the idea to create a new project is not a new one, but perhaps I can make a rule: if I take more than 20 minutes on an apparently simple problem that should work, isolate, and recreate! Happy Coding!

    Windows Forms debugging help

  • Loading a User Control onto a panel at runtime
    H Henry Venn

    Hmmm... thanks again Tom. I built a project to send to you, and it has helped - I think that the user control IS there, however it is hidden beneath a flow layout panel, which I used to structure the entire GUI. Still having the same problem however: the user control sticks to the main window, while a Windows control goes where I ask it, and stays on the panel... Will experiment a bit more. I can send you the project if a solution doesn't present itself, however I feel that its something to do with addressing the panel - but that does not explain the placement. Hold the press! I solved it - here's how, and also what surprised me: It was the sizing, like you said, because the user control would only stay on the screen if I chopped off the "With Events" clause. So I reproduced the problem in a brand new project with a main form, containing 2 panels and 2 buttons, and a user control with a label on it. Embarrassingly, the reason the control was being placed on the panel was some old code in a "Finally" clause - silly me. What surprised me is that a call to clear the panel is only required for a flow layout panel - if not, it will place the next control at the right of any existing user control. Flow layout...maybe I should not be surprised! Thanks once again - it took awhile but I got there! Henry

    Windows Forms debugging help

  • Loading a User Control onto a panel at runtime
    H Henry Venn

    Hey Tom Sorry there's not much to it really - here: Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim myAssets As New UserControlIncome() With myAssets .Location = New Point(64, 40) .Size = New Size(100, 20) .TabIndex = 0 End With Try ' Original Code causing error: ' Me.ParentForm.Controls.Item("panelMiddle").Controls.Add(myAssets) Me.Controls.Item("panelMiddle").Controls.Add(myAssets) ' this doesn't work: Me.Controls.Item("panelMiddle").Show() Catch nrx As NullReferenceException Debug.Print(" NULL ref putting user control on panel") Catch ex4 As Exception Debug.Print("Exception - plian vanilla") End Try The user control I created using VS8 and even if it is a blank "form" it only flashes on screen for a few seconds. Like I said, if I use a text control, or listview or something, it stays. I've looked at what I can on user controls but all the doc'n I can find deals with the designer - i.e. compile time. (note: the controls work perfectly if I place them on a form, make it invisible and then show it when I need to, but this is a kludge I do not need I feel). Thanks for your help so far - I am in a position where I am finishing uni and really need to find a team I can work with so I don't get bogged down for so long on these kinds of errors. Regards, Henry ps When I use a textbox or another pre-packaged MS control it is placed correctly on the panel, however when the user control briefly flashes on screen it is out of bounds of the panel, I think at the Point (64,40) of the parent form

    Windows Forms debugging help

  • Loading a User Control onto a panel at runtime
    H Henry Venn

    Thankyou, Tom. The code indeed references the panel incorrectly. I have altered it to Try Me.Controls.Item("panelMiddle").Controls.Add(myAssets) which does work better - it doesn't throw an exception. However, my user control flashes in the viewport for a few milliseconds and is gone. It is also inside the area of the parent form, which seems strange because when I use the code with a stock control it works. I am guessing that because it is a user control I may need some code in its class, however I cannot find any clues. I tried calling myUserControl.Validate() and CreateControl() to no avail. However the information you gave me was crucial. Looking at the code I assumed it was obtaining the reference for panelMiddle from the ParentForm - however the "Me" is like this in C++ so I see why this confuses it. Cheers, Henry

    Windows Forms debugging help

  • Go Hardees! (Straight to the CCR).
    H Henry Venn

    Yeah - no worries Dalek Dave, its nicer than weet-bix innit? I was there too, Sydney in the new year - how good was the weather? I'm Melbourne, only got tix for the first test, at the Gabba... if i master this dotnet maybe I'll get another hol one day!! Cheers!

    The Lounge html database com tools question

  • Loading a User Control onto a panel at runtime
    H Henry Venn

    Hello All, I am fairly new to VB and I am trying to load a user control (with a few text boxes - nothing special) using the built in snippet: Dim myAssets As New UserControlAssets() With myAssets .Location = New Point(64, 40) .Size = New Size(668, 488) .TabIndex = 0 End With Try Me.ParentForm.Controls.Item("panelMiddle").Controls.Add(myAssets) Catch nrx As NullReferenceException Debug.Print("Apparently its NULL.") End Try This is the exception. I have tried variations of different controls, even a listview. I am missing something vital, and I've spent so much time on this. If you cant see the problem from the code but have a clue please respond and I will provide additional data. Regards, H. Venn

    Windows Forms debugging help

  • Go Hardees! (Straight to the CCR).
    H Henry Venn

    What is it with you poms? Seriously....?

    The Lounge html database com tools question

  • ODBC Recordset Indexes
    H Henry Venn

    I have got a project where I link a couple of tables from an external database to use within a local Jet (access.mdb) database, for which purpose I use the DAO classes. THE DATABASE The external database Open() call looks like this :- m_dbExtern.Open(_T(""), TRUE, FALSE, _T("ODBC;")); The empty name string combined with the "ODBC;" cause the Windows ODBC selection dialog to appear, and CDaoDatabase opens a link to that. SIDE ISSUE: Anyone know how to get this dialog to default to the SYSTEM tab rather than the USER? THE RECORDSET Originally I used the straight CRecordset classes but found DAO more flexible, but its flexible. I have a class derived from CDaoRecordset which contains static attributes mirrored to what is in the table I want to access. The ODBC links to a database table written in dataflex which has a data definition file : here is the indexes it defines :- INDEX# FIELDS DES U/C LENGTH LEVELS SEGMENTS MODE ------ --------------- --- --- ------ ------ -------- ------- 1 CODE NO NO 6 3 1 ON-LINE 2 ALPHA NO NO 9 3 2 ON-LINE RECNUM NO NO 3 CODE NO NO 8 3 2 ON-LINE EMPL NO NO 4 CODE NO NO 11 3 3 ON-LINE ALPHA NO NO RECNUM NO NO The thing is, I don't know much about these recordset classes, I just want CDaoRecordset::Open() to use INDEX #2, #3 or #4 - it is defaulting to INDEX #1. Dataflex is a pretty rare database, but it does have an ODBC driver written for it - perhaps this driver defines everything I need? Hope someone can help me....P-l-ease!!! Cheers, H. Venn

    C / C++ / MFC database help question tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups