|
Hi Edbert,
Thanks for reply,
Can u gimme the solution how we can proceed with RTF format or NotePad kind of document.
Thanks in Advance!
|
|
|
|
|
Unfortunately I'm not an expert in RTF format.
You might want to check documentation on RTF yourself.
I've seen it and I can tell you it's not easy and you won't be able to do 100% of everything you can do in Word format.
"A democracy is nothing more than mob rule, where fifty-one percent of the people may take away the rights of the other forty-nine." - Thomas Jefferson
"Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." - Benjamin Franklin
Edbert
Sydney, Australia
|
|
|
|
|
Hey,
I was writing a program and it was working fine. Then I deleted a form and an error ocurred saying:
<br />
Invalid Operation Exception Was Unhandled<br />
<br />
An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an object.<br />
This has happened before with Performance Counters, but I haven't used one. Also, I remove varibles that are outside Sub Procedures (ie. Private Varible1 As String and this makes it work again. And it will also completely clear AplicationEvents.vb.It happens very randomly.
Any ideas? This is a huge program and I would hate to have to start over on it (like I have done many times before). Please help.
Thank you!
|
|
|
|
|
Hi All,
I'm facing a problem here which is I'm using the same Setup file for my VB.net project to install in 2 different OS which are win 98 and win xp, when I run it, win xp not facing any problem, it can success load the report, but when I try to run the exe file in Win 98, it have error which is "Load report Failed". Why can be like this, I'm using the same setup file for this 2 computer why win xp can load but win 98 cannot view?
|
|
|
|
|
The .NET Framework 1.x will work on Windows 98. But, does your reporting component specify that it'll work?? Somehow, I doubt it.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
How should I know whether the reporting component work o not?
|
|
|
|
|
How about going to the manufacturer's website and finding the System Requirements for the product your using??
For Crystal Reports, it's http://www.businessobjects.com[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Background:
I made a form with a button and a panel. When the User hits the button -> a user control is placed on the panel.. The User can rename and change controls within the usercontrol and the usercontrol is movable within the panel.
Problem:
I want to be able to provide the option of saving/Recalling the layout of this panel with all the usercontrol information in it. (ie. control Names, Location, and Data contained in each control within the usercontrol) There could be as many as 50 Usercontrols on the panel and the layouts can change from user to user or session to session..
I am looking for the best way to achive this and an example of such..
Thanks In advance
Adam Downs
|
|
|
|
|
Why not just write the data to an XML file and then read it in when you create the form again?
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
An Example would be useful - want to do something similar myself.
|
|
|
|
|
hello, how can i increment my menu items into my File menu! for example
File is the menu and the sub items inside the menu are : Open, Save And New And exit. now i want to accumulate some other sub items through coding because i want to add the favorites. for example like internet explorer. the favorites are accumulated automatically inside the Favorites menu! how can i add an item inside the menu and how i can make the code for that menu item. because if someone clicks on a favorite that just been accumulated .. it will do nothing because theres no code but just the menu item has been added only. can someone help me pls on this problem?? i am using vb.net
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
Try creating a MenuStrip and adding your Menu Item (ie. "ParentItem"). Then use this code to create a Sub Item:
ParentItem.DropDownItems.Add("SubItem")
|
|
|
|
|
thanks alot m8! now how can i make code inside each menu item. because i dont know how much favorites there are. i want for example if the user clicks on "Google" favorite menu item .. i want the (my internet explorer) to surf into www.google.com. how can i make this happen pls??
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
ok i find it .. you want to code into the DropDownItemClicked event of the Parent menu. then use the .clickeditem .. thanks alot anyways for your help
Adrian De Battista: .Net Programmer, Java Programmer and Web Designer.
|
|
|
|
|
How do you make a comboBox ReadOnly ?
I've read the standard answer for this question,
(Change the dropDownStyle property)
But that doesn't make the combobox ReadOnly as
you can still change the value inside the combobox by
simply using the drop-down.
I need:
- a comboBox that displays the contents in a readable
way, in other words I don't want to use the enabled property.
- the user to be able to view the complete
list within the comboBox.
I simply want the control to work as it normally would except
I want to prevent the user from changing the value.
Is there an easy way to do this ?
Thank you for your replys
Shawn Owens
|
|
|
|
|
Change it back whenever it changes.
---
b { font-weight: normal; }
|
|
|
|
|
I like that Idea.
Is there a way to have all comboBoxes use the same set of code
for a specific event ?
I have alot of comboBoxes and I don't want to have to write
code for the change event for all of them.
|
|
|
|
|
Sure. ALl you have to do is append the names of your ComboBoxes to the Handles clause of the method header:
Private Sub methodName(blah, blah) Handles ComboBox1.eventName, ComboBox2.eventName, ComboBox3.eventName, ...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I'm sorry but...?
Why display a list of options, and then not allow the selection of any?
Roy.
|
|
|
|
|
The control switches back and forth between
ReadOnly and not ReadOnly depending on who
is logged on.
Some users will have the right to make the
change, others won't. All should at least
see what the options are.
|
|
|
|
|
You could inherit a control from the combo box and add your behavior to it...
Pablo
Sometimes I think there's no reason to get out of bed . . . then I feel wet, and I realize there is.
|
|
|
|
|
I am currently looking into using the PropertyGrid Control for the first time, but am having problems with when it calls the Get and Set methods of the property. Basically, I want to write a wrapper around a set of properties that are defined in some precompiled code to allow the propertygrid to use them. Basically, I am trying to have the propertygrid directly read and write the configuration values in this class.
The problem comes in when I try to create an expandable property. The expansion works fine, but due to the way I wrote the code, the 'set' method never gets run when one of the fields in the expanded view is modified. The set method does run, however, when I edit the field directly (without expanding it).
Now it would seem that this is a limitation of using custom expanded forms, however I also noticed that using the built in System.Drawing.Point class does not have this problem. When using the property grid with this class, expanding the property and editing an expanded form causes the set method of the property to be called immediately.
I am trying to explain this as best I can, but it is rather odd and complex to explain so feel free to ask questions.
The basic buggy behavior in the code below is that when trying to change a field in the expanded 'AngleRange' set of values, the Set method for this property does not get called, so the underlying values (_MILGeometricFinder.Models.Item(_ModelNum).Angle.Value, .NegativeDelta, .PositiveDelta) do not get changed.
On the otherhand in the ModelOrigin Property, any time you change the values of the expanded fields, the set gets called immediately and updates the proper values. As far as I can tell, this must have to do with the way that the System.Drawing.Point class is declared. It seems to have a way of informing the propertygrid control that a set has been called on one of its properties, so the propertygrid should call a set on that particular property.
Here is my code:
Main form code to link the propertygrid in:
PropertyGrid1.SelectedObject = New ModelFinderProperties(_MILGeometricFinder)
Excerpt From the PropertyList that the Propertygrid Reads:
Imports System.ComponentModel
Imports Matrox.ActiveMIL
'''
<DefaultPropertyAttribute("Title")> _
Public Class ModelFinderProperties
'''
Private _MILGeometricFinder As AxMatrox.ActiveMIL.ModelFinder.AxMModelFinder = Nothing
Private _ModelNum As Integer = 1
Public Sub New(ByRef ModelFinder As AxMatrox.ActiveMIL.ModelFinder.AxMModelFinder, Optional ByVal ModelNum As Integer = 1)
_MILGeometricFinder = ModelFinder
_ModelNum = ModelNum
End Sub
<CategoryAttribute("Training Parameters"), _
Browsable(True), _
[ReadOnly](False), _
BindableAttribute(False), _
DefaultValueAttribute("(0.0,0.0)"), _
DesignOnly(False), _
DescriptionAttribute("The (0,0) Point of a found model.")> _
Public Property ModelOrigin() As Point
Get
Return New Point(_MILGeometricFinder.Models.Item(_ModelNum).ReferenceX(), _
_MILGeometricFinder.Models.Item(_ModelNum).ReferenceY())
End Get
Set(ByVal Value As Point)
_MILGeometricFinder.Models.Item(_ModelNum).ReferenceX = Value.X
_MILGeometricFinder.Models.Item(_ModelNum).ReferenceY = Value.Y
End Set
End Property
'''
<CategoryAttribute("Search Parameters"), _
Browsable(True), _
[ReadOnly](False), _
BindableAttribute(False), _
DefaultValueAttribute("(0.0,0.0)"), _
DesignOnly(False), _
DescriptionAttribute("The starting and offset angle ranges to use when searching.")> _
Public Property AngleRange() As RangeCls
Get
With _MILGeometricFinder.Models.Item(_ModelNum).Angle
Return New RangeCls(.Value, .NegativeDelta, .PositiveDelta)
End With
End Get
Set(ByVal newValue As RangeCls)
With _MILGeometricFinder.Models.Item(_ModelNum).Angle
.Value = newValue.Reference
.NegativeDelta = newValue.NegativeDelta
.PositiveDelta = newValue.PositiveDelta
End With
End Set
End Property
End Class
My RangeCls:
Imports System.ComponentModel
<TypeConverter(GetType(RangeClsConverter))> _
Public Class RangeCls
'''
Private _Reference As Double
Private _NegativeDelta As Double
Private _PositiveDelta As Double
'''
Public Sub New(ByVal Reference As Double, ByRef NegativeDelta As Double, ByRef PositiveDelta As Double)
_Reference = Reference
_NegativeDelta = NegativeDelta
_PositiveDelta = PositiveDelta
End Sub
'''
Public Sub New()
Me.new(0, 0, 0)
End Sub
<DescriptionAttribute("Set the reference value.")> _
Public Property Reference() As Double
Get
Return _Reference
End Get
Set(ByVal Value As Double)
_Reference = Value
End Set
End Property
'''
<DescriptionAttribute("Set the positive delta.")> _
Public Property PositiveDelta() As Double
Get
Return _PositiveDelta
End Get
Set(ByVal Value As Double)
_PositiveDelta = Value
End Set
End Property
'''
<DescriptionAttribute("Set the negative delta.")> _
Public Property NegativeDelta() As Double
Get
Return _NegativeDelta
End Get
Set(ByVal Value As Double)
_NegativeDelta = Value
End Set
End Property
End Class
Friend Class RangeClsConverter : Inherits ExpandableObjectConverter
Public Overloads Overrides Function _
CanConvertTo(ByVal context As System.ComponentModel.ITypeDescriptorContext, _
ByVal destinationType As System.Type) As Boolean
If (destinationType Is GetType(RangeCls)) Then
Return True
End If
Return MyBase.CanConvertTo(context, destinationType)
End Function
Public Overloads Overrides Function _
CanConvertFrom(ByVal context As System.ComponentModel.ITypeDescriptorContext, _
ByVal sourceType As System.Type) As Boolean
If (sourceType Is GetType(String)) Then
Return True
End If
Return MyBase.CanConvertFrom(context, sourceType)
End Function
Public Overloads Overrides Function _
ConvertFrom(ByVal context As System.ComponentModel.ITypeDescriptorContext, _
ByVal culture As System.Globalization.CultureInfo, _
ByVal value As Object) As Object
If TypeOf value Is String Then
Try
Dim s As String = CType(value, String)
Dim rangeParts(3) As String
Dim _RangeCls As RangeCls = New RangeCls
Dim delimiterIndex As Integer
delimiterIndex = InStr(s, "[")
rangeParts(0) = Left(s, delimiterIndex - 1)
s = Mid(s, delimiterIndex + 1)
delimiterIndex = InStr(s, ",")
rangeParts(1) = Left(s, delimiterIndex - 1)
s = Mid(s, delimiterIndex + 1)
delimiterIndex = InStr(s, "]")
rangeParts(2) = Left(s, delimiterIndex - 1)
_RangeCls.Reference = Convert.ToDouble(rangeParts(0))
_RangeCls.NegativeDelta = Convert.ToDouble(rangeParts(1))
_RangeCls.PositiveDelta = Convert.ToDouble(rangeParts(2))
Return _RangeCls
Catch ex As Exception
Throw New ArgumentException("Can not convert '" + _
value + "' to type RangeCls")
End Try
End If
Return MyBase.ConvertFrom(context, culture, value)
End Function
Public Overloads Overrides Function _
ConvertTo(ByVal context As _
System.ComponentModel.ITypeDescriptorContext, _
ByVal culture As System.Globalization.CultureInfo, _
ByVal value As Object, ByVal _
destinationType As System.Type) As Object
If (destinationType Is GetType(System.String) AndAlso _
TypeOf value Is RangeCls) Then
Dim _RangeCls As RangeCls = CType(value, RangeCls)
Return _RangeCls.Reference & " [" & _RangeCls.NegativeDelta & _
", " & _RangeCls.PositiveDelta & "]"
End If
Return MyBase.ConvertTo(context, culture, value, destinationType)
End Function
End Class
|
|
|
|
|
Hi,
this is because the PointConverter overrides GetCreateInstanceSupported (returns true) and CreateInstance (which returns a new Point when sub properties are modified). You should do the same in your own converter. Hope this helps.
|
|
|
|
|
I need to know how to parse an XML file with different node names.
jds
|
|
|
|
|
With XPath and the DOM ( XMLDocument class ), probably.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|