Jump to content
Xtreme .Net Talk

ChubbyArse

Members
  • Posts

    19
  • Joined

  • Last visited

ChubbyArse's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Am I able to use the FlagsAttribute when my enum is numbers as such???? <FlagsAttribute()> Public Enum CustomCCItemType As Long Drawing = 1 PNumber = 2 ConsumablePNumber = 3 RepairSalvageDrawing = 4 ProcurementDS = 5 LOP = 6 WeightReport = 7 Modification = 8 Amendment = 9 MagneticTape = 10 DesignSpecification = 11 ToolDrawing = 12 TestRig = 13 TestRigDrawing = 14 StandardPart = 15 End Enum The reason they are numbered is that they correspond to a reference key in a table which I want to build a search SQL string for. What I am reading is that a flags enum has to be numbered 1,2,4,8,16 etc...... In that case, how can I use this enum as a flag?
  2. Hi All, I want to do something like the flags property in the old commondialog. Where you used the OR to specifiy the options, I'd like to build the same into my function call. How do I do this. For example: Dim lng As Long lng = 1 Or 2 How do I establish that lng contains 1 and 2? What is this technique described as in vb.net, and where would I be able to read up on it? Thanks Alex
  3. Hi All, Apologies if this question has been asked before but the search will not allow MDI as it's less than 4 characters!!!! Anyway, I am currently developing an application, where I have a Application window, which has buttons on a toolbar which fills the screen. Within that windows I am opening different forms using the MDI conatiner. Problem I have is that I can't open any showdialog forms, cause of the MDI container. I'd like the child forms to have there own menus, and for anything I want to keep the user on, I can open as showdialog. I understand that I am cutting across the concept of MDI, but I like the kind of MS Access application feel, where you open forms within the main screen. Am I missing a trick, or is there some purchasable control which will allow me to do this? Alex
  4. I have two forms one with one combo (frmSearch), and another with three combos (frmPart). Each combo is filled using a class object which essentially opens a datatable based on an SQL query, and sets the display / valuemembers. frmSearch has one unbound combo. frmPart has three combo's which are bound to a datatable, using the form's currency manager. Both forms have a debugging button which displays the row count of each combo. When I open frmSearch, The combo is filled, and the first entry is visible. Clicking the debugging button tell me there are 11 rows in the combo. Then, when I click on the title bar (the blue bit at the top) and drag the form, the the combo clears, and cliking the debugging button tell mw the combo is now empty!!!!!! When I open frmPart (the 3 bound combos), randomly, some of the combos are filled, sometimes all, sometimes, none, sometimes two of them are filled, and the debugging button reports the contents in line with each combo's state. On one occasion I just moved the mouse and all three combo's cleared and had no rows in them. Has anybody else had experience of this?? I am baffled? Alex
  5. I know how to check an object is nothing.
  6. With frmSearch 'How do I test frmSearch here for nothing? 'If I can at all???? 'If I do this within a with statement frmSearch = new frmSearch .MDIParent = Me.ParentForm 'The Code falls over on the line above, 'statingobject not set to an instance. End With Does a with statement, only allow you access tot he objects properties and methods? Are you allowed to modify the actual object (set it to a new, check for nothing)?
  7. Thanks I was really asking how do you set an object, or test for is nothing when the object is in a with statement?
  8. Hi All. I have a code snippett, that I'd like to use the with statement, to make it more readable. If frmComponentSearchForm Is Nothing Then frmComponentSearchForm = New frmPartSearch frmComponentSearchForm.MdiParent = Me.ParentForm frmComponentSearchForm.Show() Else frmComponentSearchForm.Show() End If How would I use the with statement, beacuse as far as I know I can't use the = operator with the object which is the subject of the with: With frmComponentSearchForm If withobject Is Nothing Then withobject = New frmPartSearch .MdiParent = Me.ParentForm .Show() Else .Show() End If End With Is there a better may of doing this? Thanks Very Much!
  9. Solved: Managed to solve this without using relflection, using the callbyname function. It allows you to get/set a property of an object: CallByName(txtForename, "Text", CallType.Get) CallByName(txtForename, "Text", CallType.Set, "Alex") Alex
  10. Hi, I'm writing a generic class to support databinding in a form. I have a formfields collection which collects formfield objects which have each fieldname, controlname, mandatory, defaultvalue and originalvalue properties. The problem i have is that when I want to check the value in the control, this could be stored in one of a few different properties (at the moment - text, checked, value, selectedvalue). I would like to have a BindingProperty on the formfield object that states which property is the binding property. This would be a string ("text", "checked", "value", "selectedvalue", this would supply the binding.add method when I loop through and bind the controls). But how do I get the value of the property when the propertyname is stored as a string?? Can you reference a controls property some other flashier way?? Am I barking up the wrong tree, or has someone already does this somewhere ......? (don't care if they have though, this is great learning curve!!!) Cheers Alex Stevens Gloucester, England
  11. How can I enumerate a control's properties in .Net? I bascially want to do this (vb6 code): *****Start Code***** ctl = control strPropName = "value" For each prop in ctl.properties If propr.name = strPropName msgbox prop.value Exit For End if Next prop *****Start End***** Thanks
  12. I have a control stored as an object. The control has a databinding, how can I get the value stored in the controls property which is bound? This gives me the bound fieldname: ctl.DataBindings.Item(0).BindingMemberInfo.BindingField().ToString This gives me the bound property: ctl.DataBindings.Item(0).PropertyName.ToString But I can't figure out how to get the VALUE of the bound property? Thanks
  13. Hi, How can I get a controls property value in code, by using a string value of the propertyname. Eg. In VB6 i would have strProp = "Text" ctl.Properties(strProp) How can I do this in .Net. I have a class which contains a control - could be combobox, textbox. In the currentvalue property I want to return the bound value of the control. For a textbox it would be ctl.text for a combobox it woul be .SelectedValue Is there an alternative way to return the value Thanks Alex
  14. They click the new button which executes the code above Just the new button bit that is....
  15. My Code: (NewButton)... cm.EndCurrentEdit() cm.AddNew() (User modifies fields) (SaveButton)... cm.EndCurrentEdit() bolNewRecord = dsFormData.HasChanges(DataRowState.Added) 'Check if the record has changed, if not return true If Not dsFormData.HasChanges(DataRowState.Modified) Then Return True Else Msgbox("Do you wish to save........") End If etc.........
×
×
  • Create New...