|
Dear Community,
can anybody give me a hint how I can change the attribute for a property during Run.Time?.
My current problem is that I use a PropertyGrid to show my defined properties. Depending on the selcetion of a certain Property (drop down menu) I want some other properties to be shown [browsable(true) ] or not to be shown [browsable(false) ].
ThanX...
|
|
|
|
|
Simple way to do is, create two classes one base class another derived class. In base class property set browsable attribute to true and in derived class property set browsable attribute to false... Interchange object from baseclass to derived class.
Thats it...
|
|
|
|
|
SoFar [...] how can I interchange object from baseclass to derived class? A sample could be helpful. thX
|
|
|
|
|
how to add , delete the dsn for ms access database.?
|
|
|
|
|
Hope the Article by Bas Goedemans here[^] in CP will help you
Regards,
Satips.
|
|
|
|
|
Hi Satips......
i needed code for vb.net.It is in C#.If u please provide some code in vb.net
|
|
|
|
|
Why do you think you even need one?
If you're trying to create one so you can use it in your own app, you're wasting your time. There's nothing you can do with a DSN that you can't already do in the connection string you use to connect to the database.
|
|
|
|
|
How to create Reports with SQL Reporting Service and Visual Studio .NET. what are the steps to create reports. Please provide steps or demo project.
|
|
|
|
|
i have devolped a component with a textbox and a button.but the problem is i can select the full component only.i am not able to select the button control and increase the size. can i change any event or property for that?......
|
|
|
|
|
When creating your component you need to have properties for the aspects of the controls contained within the component that you want to be customizable (width, height, text, backcolor, forecolor, etc).
"Okay, I give up: which is NOT a real programming language????"
Michael Bergman
"Well yes, it is an Integer, but it's a metrosexual Integer. For all we know, under all that hair gel it could be a Boolean."
Tom Welch
"Let's face it, the average computer user has the brain of a Spider Monkey."
Bill Gates
|
|
|
|
|
Actually what i want is after placing the component in form in designtime when i click in button i want to select the Button in the component individually other than selecting the full component.
|
|
|
|
|
By default, you can't. The button and textbox, since you made a custom user control with them, are treated as a single control. You have no design-time control over the individual elements of the UserControl. Unless you include that functionality in the code of your UserControl.
The quick way to do it would be to add a ButtonSize property to your UserControl to expose the size of the constituent button. You will won't be able to select the button in the designer, but you'll be able to change it's size:
Public Class MyUserControl
.
.
.
Public Property ButtonSize() As Size
Get
Return ucButton.Size
End Get
Set(ByVal value As Size)
ucButton.Size = value
End Set
End Property
.
.
.
|
|
|
|
|
Hi A
You can set the public properties for that particular Controls such as ButtonX,ButtonY,ButtonWidth , ButtonHeight etc, or Else you can dock or resize with reference to parent control .
Regards and Wishes
Navneet Hegde
Nashik(City Of Pilgrimage)
Develop2Program & Program2Develop
|
|
|
|
|
I've .Net v1.1.4322 and .Net v2.0.50727 both installed on my machine.
I've a Excel hosted VBA Script test harness. It makes calls to .Net v2.0.50727 assemblies through COM callable wrapper (CCW). But I found during running this Excel test script, the wrong version of .Net runtime enviroment triggerred! It's supposed that the .Net v2.0.50727 runtime would be launched to run, not the .Net v1.1.4322. All the assemblies called by the script are developed in .Net v2.0.50727.
The below message was extrated from the Assembly Binding Log Viewer (Fuslogvw.exe). As we can see, the v1.1.4322 fusion.dll was loaded instead of v2.0.50727 fusion.dll. But SG.AG.Qt.Act.Client.Streams.dll and all other assemblies are developed in .Net v2.0.50727. So it crashed. Would anyone know why Windows chose .Net v1.1.4322 rather than v2.0.50727 to run my script? How can I indicate Windows to choose v2.0.50727 correctly? Thanks so much.
*** Assembly Binder Log Entry (6/29/2007 @ 3:18:58 PM) ***
The operation failed.
Bind result: hr = 0x80131107. No description available.
Assembly manager loaded from: C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\fusion.dll
Running under executable C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: Where-ref bind. Location = C:/WINDOWS/assembly/GAC_MSIL/SG.AG.Qt.Act.Client.Streams/4.5.0.0__ea69dc1d65f83a25/SG.AG.Qt.Act.Client.Streams.dll
LOG: Appbase = C:\Program Files\Microsoft Office\OFFICE11\
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : (Unknown).
===
LOG: Processing DEVPATH.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:LOG: Assembly download was successful. Attempting setup of file: C:/WINDOWS/assembly/GAC_MSIL/SG.AG.Qt.Act.Client.Streams/4.5.0.0__ea69dc1d65f83a25/SG.AG.Qt.Act.Client.Streams.dll
LOG: Entering run-from-source setup phase.
ERR: Error extracting manifest import from file (hr = 0x80131107).
ERR: Failed to complete setup of assembly (hr = 0x80131107). Probing terminated.
|
|
|
|
|
|
Have a little patience man. You've got a problem that is not easily solved and takes some research.
Open RegEdit, then open HKEY_CLASSES_ROOT, then find the CLSID folder, then the GUID for your class. You can also click on the CLSID folder and then search the values for your class name. Open the GUID for your class, then open teh InProcServer32 folder in there. In there, you should find a RuntimeVersion value that should read "v2.0.50727". If it doesn't have this value, this might be your problem.
You might also want to look at this[^] MS KB article. There's a bug in Office when hosting .NET 2.0 components...
|
|
|
|
|
Thanks very much. It's quite helpful. All classes' InProcServer32 attributes are fine in the registry. Currently we've figured out a walkaround - placing an application configuration file to specify which .Net framework version to run the application.
|
|
|
|
|
Hi guys,
I need to get the idle time of my mouse & keyboard, to execute a screensaver. Is there any API which does this? Its in VB
Thnx for any help.
The name is Sandeep
|
|
|
|
|
Xandip wrote: I need to get the idle time of my mouse & keyboard, to execute a screensaver
Why? The system already does this automatically.
Xandip wrote: Is there any API which does this?
No.
Why not just write a screen saver and install it? The system will handle the rest.
|
|
|
|
|
Here's what I'm trying to do, I have an ErrLog.txt file that logs any exceptions that happen in the application and I'm wanting to parse this file and load it into a DataGridView. The file (for now, I can change it if needed) is in this format:
Title: Error title
Message: ex.Message value
StackTrace: Exception stack trace
Date/Time: Date & Time it happened
I'm fairly certain I'll need to make it a comma delimited file and have Title,Message,StackTrace,Date/Time as the first line (to handle the DataGridView Headers) but I'm really having a hard time wrapping my head around how to get the text from the file into the DataGridView. Anyone help with this or at least have somewhere I can start (I've Googled and haven't found much but theres always a chance I'm not using the right keywords but who knows)
Last modified: 3hrs 40mins after originally posted --
"Okay, I give up: which is NOT a real programming language????"
Michael Bergman
|
|
|
|
|
Hi,
You could try and adapt the way your ErrLog.txt file gets written, or use a streamreader to read through the file, but you could also consider one of the following two alternatives:
1. Forget about the DataGridView; ideally nobody will ever have to look at the information in the file, or better, nothing will ever get written to it. In other words, you will need very little access to this information, so why put an inordinate amount of time in developing this idea, when you can put the data in a ListBox, with minimal effort, or even just open the text file by hand. Ofcourse this depends on the average amount of errors thrown.
2. Forget about ErrLog.txt;
Psycho-*Coder*-Extreme wrote: I'm fairly certain I'll need to make it a comma delimited file
Whether this or some other solution, in the end you will have to change the way your app writes the error data to the file. So consider the easiest way to fill a datagrid, which I would say is a dataset. The easiest way to fill a dataset from a file, is with the use of xml. I.e. your app runs > an error is thrown > an entry is made in DS_ErrorLog1 > DS_ErrorLog1 is the data source for the datagrid > push the button, et voila, the datagrid is shown. (and if you want > when the app is closed you call DS_ErrorLog1.WriteXml("ErrorLog.xml") , and when the app is launched you call
DS_ErrorLog1.ReadXml("ErrorLog.xml")<br />
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
Johan,
Thanks for the ideas. When first created the error log I didn't have the idea of a reader for it so I didn't bother with a comma delimited file, now I know that part I'm going to have to change. Some of the errors are unavoidable, we are dealing with an off-site 3rd party that my application is communicating with, and given a process, one of 55+ errors can be returned, some of which can cause the application to "not act so nicely". I feel I have done an adequate job of exception handling, but I don't feel that for the other developer working on this with me (thus the reason behind the error log to begin with.
I am creating and implementing this so when an error does occur (60% of which is from teh 3rd party host), Id like to be able to go to the users desk, open the log viewer and find the error, even sort by date. I still like the writing it to the text file, but I can always convert it to a DataSet then populate the grid from there, I was just hoping for possibly a cleaner solution.
|
|
|
|
|
Hi,
I see your problem. Once again I recommend xml over delimited text, simply because the basic principle is pretty much the same, but getting data from an xml file into a datagrid is more straightforward.
Otherwise feel free to use this code in your error handling:
Public Function SendEmail(ByVal oFrom As String, ByVal oTo As String, ByVal oSubject As String, ByVal oText As String, Optional ByVal oCC As String = "", Optional ByVal oBCC As String = "", Optional ByVal oPri As Integer = 0)<br />
Try<br />
Dim mailmsg As New System.Web.Mail.MailMessage<br />
With mailmsg<br />
.From = oFrom<br />
.To = "your.colleague.coder@yourcompanyname.com"<br />
.Cc = oCC<br />
.Bcc = oBCC<br />
.Subject = oSubject<br />
.Body = "You suck!!!"<br />
.Priority = oPri<br />
End With<br />
System.Web.Mail.SmtpMail.SmtpServer = "smtp_server_name"<br />
System.Web.Mail.SmtpMail.Send(mailmsg)<br />
Catch Ex As Exception<br />
MsgBox(Ex.Message)<br />
End Try<br />
End Function
I Hope you manage to solve the problem, good luck,
Johan
My advice is free, and you may get what you paid for.
|
|
|
|
|
I would love nothing more than to do this, but I got a feeling it would catch the eyre of my superiors
"Okay, I give up: which is NOT a real programming language????"
Michael Bergman
"Well yes, it is an Integer, but it's a metrosexual Integer. For all we know, under all that hair gel it could be a Boolean."
Tom Welch
"Let's face it, the average computer user has the brain of a Spider Monkey."
Bill Gates
|
|
|
|
|
Hello,
I have a datagridview which I fill with data using a bindingsource. I am using typed datasets and have set the properties of the bindingsource to the typed dataset and data table using the designer. I can then use the table adapter to fill the dataset and assign the data source of the datagridview to the bindingsource. This works fine. My code shows below.
However, I am not sure about the code that will allow me to edit the datagridview and then save all the changes. The user will enter or edit some of the values in the grid. Once they have finished they will click a button to save all changes to the database.
Does anyone have any code samples of this?
Many thanks for any advice,
'Fill the software part<br />
Private Sub FillSoftware()<br />
Try<br />
Me.TA_Software_dsComponent_Equipment.Fill(Me.DsAddComponetAndEquipment.Software)<br />
Me.dgvSoftware.DataSource = Me.bsSoftware<br />
<br />
Me.HideSoftwareColumns()<br />
<br />
Catch ex As Exception<br />
MsgBox(ex.Message)<br />
End Try<br />
End Sub
|
|
|
|
|