Jump to content
Xtreme .Net Talk

I Schobert

Avatar/Signature
  • Posts

    32
  • Joined

  • Last visited

Personal Information

  • Occupation
    Developer
  • Visual Studio .NET Version
    2003
  • .NET Preferred Language
    VB.NET

I Schobert's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Adam, Read carefully through my message. Did you see the section telling you to create this in your called form: Private CallerForm as NAMEOFYOURCALLINGFORM Public Sub New (frm as NAMEOFYOURCALLINGFORM) MyClass.New() CallerForm = frm End Sub That will give you an overloaded sub new with the parameter. And gabru, of course there is already a Sub New, there is always one when you create a form. This Sub New is generated automatically and takes no parameters....
  2. Sorry gabru, I didn't see that you were responding ...
  3. Ok, so let me try on this Friday :) you initialize this form like this: OpenForm = New frmMaterialSelect() OpenForm.ShowDialog(Me) Try this instead: OpenForm = New frmMaterialSelect(Me) OpenForm.ShowDialog() in the frmMaterialSelect, add the following to the initialize section, right below the Public Sub New () method Private CallerForm as NAMEOFYOURCALLINGFORM Public Sub New (frm as NAMEOFYOURCALLINGFORM) MyClass.New() CallerForm = frm End Sub In your Done button, loop through your array and fill the list in the caller form by using this reference, like: CallerForm.ListBox1.[and here whatever you want to do to it] Does this work? It would be cool if get this over with during this week :)
  4. Adam, I was reading through the previous messages in this thread and I have to say that, besides confusing each other, you also lost me. I would like to help you, it seems you don't have a major issue here. Could you do me a favor and start fresh. Please state what you need, what you got, and where the problem is. Thanks... :)
  5. I see, you are having a problem in the parenting definition, who owns who. I would like to give you an idea of how I solved a similar problem: I created a singleton (shared) class that maintains nothing but an arraylist to hold any instance of a form that I wish it should hold. If you are not familiar with the concept of a singleton class, it is invoked only once and stays open until all references to it from the app are removed (in my case, until I close the app). Now, I always add the frmMain as the first entry to this arraylist, then, at any point, I can reference right back to it with code like: Dim ArrList As ArrayList = SharedForms.FormArrayList CType(ArrList.Item(0), frmMain).Panel1.Text = "Whatever" [sorry, I am VB guy, but I am sure you can translate to C#] That will for sure resolve your referencing problem... Please let me know if this is helpful to you ...
  6. You could try to set it when you initialize the new form, like: //new instance frmUsers fmUserDetail = new frmUsers(); frmUsers.MdiParent = theInstanceOfParentForm; Your problem is most likely that you don't know the instance of the MDIParent, right? Just pass it into this form and then you can refer to it at any time. I hope this works ...
  7. It's a little hard to help when one cannot see what you are doing, even from a conceptual perspective. Under normal circumstances, you should not have a problem ... Can't you try to "generalize" your code and then post it? I open tons of form on top of other forms and never had a problem. Take a close look at the stuff you do in this form load ...
  8. Could you post the code you have in your main form's load event?
  9. Hey, Did you try to set the TopMost property of your form to be true? You could do this at the time when you want the form to be in front of all other forms (given they don't have this prop. set to true)...
  10. Drstein99, can it be that you have set the TopMost property of your app form to be true? If not, what kind of a FormBorderStyle property do you use? Maybe try another one, I believe, for example, that FixedDialog would always show up on top (although I am not sure). Let me know if it works....
  11. I am not quiet sure that I understand your question. What I get is that you wish to have variables that return only values when they are assigned, and otherwise Null. How about if you don't assign a default value to them and declare them at the beginning of the class, like: Private myVariable as String Private myOtherVar as Double Now, in case of a db call, only assign values to the ones that do not have a dbNull return (test for "Not IsDbNull"). All other variables should have a value of Nothing at this point. Does that help?
  12. You are very welcome Spiel79 :D
  13. You could try to pass the calling form into the constructor (that is one way besides many others). Like when you call it, say AskDate.Date askDate = new AskDate.Date(This); [i am not good at C#, but in VB it's Me that you pass] Now, in the sub new of the called form, populate a local variable in the class with the passed form. When you are done, and you want to pass your data back, say someting like: MyParentForm.Label1.Text = myPassValue Whereby MyParentForm is the name of the local variable that you used to store the passed form. Does it work?
  14. Uh, Did you try to set the Appearance property of the toolbar to flat? (I don't have XP)
  15. WMZ, Sorry, then I don't know the answer. And you are right, flat-style is not one of the options of a toolbar's button object, only Push-, Toggle-, and DropDownButton (plus seperator) are available. I hope someone will be able to give you (and me) the answer. Sorry again
×
×
  • Create New...