|
As an alternative to regsvr32, you could (pinvoke) call the DllRegisterServer function in the Dll. Regsvr32 executes this function in the Dll to perform the registration.
|
|
|
|
|
Hey
I have inherits the Textbox-control but i'm
having problem with my properties that i have added.
this is the class with the property added:
Public Class TPTextBox
Inherits System.Windows.Forms.TextBox
private _blndirtyEnabled as boolean
Public property DirtyEnabled as boolean
set (byval value as boolean)
_blndirtyEnabled = value
end set
Get
return _blnDirtyEnabled
Get
end property
end class
now i want to edit the value through the "properties"-window in designmode to "true"
but it always returns to "false" when i try to save the Form that i have dragged the control to.
in the designer file the form has put this line:
me.TextBox1.DirtyEnabled = false
i want it to store the value that i have changed it to but it always return to "false".
i have removed the line but it wont work.
whats is wrong
|
|
|
|
|
Odd, I tried it and didn't have any trouble. Did you try changing that line so it sets the property to true, instead of just removing it. Also you might want to try using the control in a new project to see if the problem persists.
|
|
|
|
|
<defaultvalue(gettype(boolean), "true"),="" category("appearance"),="" description("")=""> _
Public Property DirtyEnabled() As Boolean Implements Interfaces.IDirtyTracking.DirtyEnabled
Get
Return _blnDirtyEnabled
End Get
Set(ByVal value As Boolean)
_blnDirtyEnabled = value
End Set
End Property
i forgott to mention that i have this above the "property"
<defaultvalue(gettype(boolean), "true"),="" category("appearance"),="" description("")=""> _
when i removed it it worked fine.
|
|
|
|
|
A user fills out info on a TabPage in a TabControl. When the user clicks on another TabPage I want to validate the information before switch to the new TabPage. So far I'm using the Leave event to validate the info but if there is a problem I want it to stay on that TabPage. How can I prevent it from switching to a new TabPage if needed?
|
|
|
|
|
can't you disable all other tab pages until they have saved?
|
|
|
|
|
Urgent!!!
Can someone please help me about how to read multiple .doc files, say 40 word files into an array of String
mmorupisi
|
|
|
|
|
I have the following code in a DLL, and it must be called from a VB6 application.
That's the code:
#######################################
#include
struct tpteste
{
int i;
};
void __stdcall test( tpteste **l )
{
tpteste *t = new tpteste[4];
t[0].i = 99;
t[1].i = 98;
t[2].i = 97;
t[3].i = 96;
*l = t;
}
void __stdcall doNothing( void )
{
tpteste *w = NULL;
test(&w);
}
#######################################
I need to discover how to call the test function from VB passing a pointer-to-pointer (or any workaround).
If someone can help... thanks in advance.
|
|
|
|
|
VB6 doesn't support pointers, so I fail to see how a poiinter-to-a-pointer is going to work. VB can pass in parameters ByRef, which is a pointer to an object or value, but that's about as far as it's going to go.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
i am doing a world quiz. what is the capital city of...? once a question has been asked, how can i stop the question from being repeated until the quiz has been reset.
Regards
Zeldacat
|
|
|
|
|
Store your used questions to a HashTable, then when you want to ask a new question check whether it already exists there.
|
|
|
|
|
That depends on how you store the questions and how you pick the questions to ask.
You can keep a list of unused questions, and remove it from the list once it's used. You can keep a flag in each question that determines if it has been used or not. You can store an identifier or reference of the used questions to compare against. You can prepare a list of questions in the order that they will be asked and just loop through the list.
---
single minded; short sighted; long gone;
|
|
|
|
|
I suggest adding them to a list and deleting them after they are used. You can add them as strings to a string collection.
Dim Questions as system.collections.specialized.stringcollection<br />
<br />
Dim UsedQuestion as system.collections.specialized.stringcollection<br />
<br />
dim ranQuestion as new random<br />
<br />
Dim CurretnQuestion as string = questions.item(ranquestion.next(-1, questions.count +1 )<br />
<br />
questions.remove(indexof(CurrentQuestion))<br />
<br />
UsedQuestions.add(currentQuestion)
In this way, you never risk repeating a question.
Posted by The ANZAC
|
|
|
|
|
Hi all! I have a VBA question. I know what the error means when doing a Windows("Workbook Name").Activate or a Sheets("Sheet Name").Select. It means that the object does not exists? Well, I am pretty sure.
But this is really strange to me. There is one Workbook named EndOfMonth.xls. The macro is from this workbook. There is also one worksheet in the workbook named EndOfMonth.
The Sheets("EndOfMonth").Select command is where I am getting the error. But I copied and pasted this from a recorded macro and the sheet is there.
Why would this happen?
Thanx in advance!
Jude
|
|
|
|
|
I have an application that I'm writing to load a spreadsheet, massage the data, and then populate a sql server table. This code works great except the cell for a date field in the spreadsheet is saying it's dbnull but when you look at the spreadsheet and the date is there and valid.
Dim oConn As System.Data.OleDb.OleDbConnection = Nothing
Dim ds As System.Data.DataSet = New System.Data.DataSet, dsRow As Data.DataRow = Nothing
Dim oComm As System.Data.OleDb.OleDbDataAdapter = Nothing, dsCol As Data.DataColumn = Nothing
Dim oAdj As Adjuster = Nothing, oState As New Adjuster.State
Try
oConn = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0; " & _
"data source='c:\temp\adjusterlicense.xls';" & _
"Extended Properties=Excel 8.0;")
oComm = New System.Data.OleDb.OleDbDataAdapter("select * from [CZ Adjuster Licenses$]", oConn)
oComm.Fill(ds)
For i As Int16 = 8 To ds.Tables(0).Rows.Count - 1
dsRow = ds.Tables(0).Rows(i)
.
.
.
'col 9 = 10/31/07
'col 10 = AJ40008453
For iState As Int16 = 9 To ds.Tables(0).Columns.Count - 1 step 2
'' why is IsDBnull(dsRow(9)) = True when IsDBNull(dsRow(10)) = False
Next
Next
What's interesting is that if I export this file into a comma delimited file, the date is there.
Any help would be greatly appreciated...
Nathan
|
|
|
|
|
Has the column been established as a type that wont accept the date by that point?
Cleako
|
|
|
|
|
The first row of the spreadsheet is blank which I thought maybe causing the problem. I put a dummy date in the date column so that it would be looked at as a date but it didn't help.
|
|
|
|
|
hi,
i have to add a button save in the dataGrid in order to save the changes i made in the checkBoxs for each row,
syntax Help plz for the button , the detecting of current row in DataGrid
vb.net 2003
thanks
|
|
|
|
|
I found all of this information out for myself from Google and trial and error, Im glad to help but we cant tell you every step of the project.
Anyway, this is another template column with a button and a command to call OnClick. Unless you are talking about a Editable datagrid and then you should Google for that.
Cleako
-- modified at 10:16 Wednesday 14th February, 2007
|
|
|
|
|
Hi..
I want to know how to extract the zip file using vb.net. If any one know please help me.
Thanks.
Navas.M
|
|
|
|
|
|
When it comes to coding I think I am too paranoid about input and I would like some feedback to help me rid myself of the obsession (Im not talking about input validation but rather Null Reference Exceptions or formatting strings that need to be non-blank).
I almost always perform 2 checks on a string and include a trim no matter what.
If strValue IsNot Nothing AndAlso strValue.Trim <> "" Then
I have read some things saying that I should probably use strValue.Length > 0 . What I am curious about is should I always perform the .Trim or is if strValue = " " considered 0 length?
Also on DB items I usually perform 3 checks.
If dr.Item("ColumnName") IsNot DBNull AndAlso dr.Item("ColumnName") IsNot Nothing AndAlso dr.Item("ColumnName").ToString.Trim <> "" Then
How much of that is necessary?
This may seem ridiculous but I guess Im tired of doing so much if I dont need to.
Thanks!
Cleako
|
|
|
|
|
cleako wrote: I almost always perform 2 checks on a string and include a trim no matter what.
If strValue IsNot Nothing AndAlso strValue.Trim <> "" Then
If you are using .NET 2.0 this can be shortened to
If Not String.IsNullOrEmpty(strValue) Then NOTE: It doesn't trim the string first.
cleako wrote: What I am curious about is should I always perform the .Trim or is if strValue = " " considered 0 length?
" " is considered to be not empty. An empty string contains zero characters.
cleako wrote: If dr.Item("ColumnName") IsNot DBNull AndAlso dr.Item("ColumnName") IsNot Nothing AndAlso dr.Item("ColumnName").ToString.Trim <> "" Then
How much of that is necessary?
It depends on what you are checking for. You could make it more efficient by assigning the result to a local variable first then it doesn't have to repeatedly look up the value for the column.
Personally, if you are having to trim whitespace off the strings all the time I'd tread that as a data error and would try to clean the data at source first. NOTE: if you are using a CHAR column in the database then it will always space pad the value. I'd recommend moving to VARCHAR unless you have a compelling reason to stay with CHAR (e.g. A legacy system you share the database with would freak if it wasn't space padded)
|
|
|
|
|
Hey,I'm new for the group, I have a little problem with menuItems.
I'm developing a pocket pc application in vb.net (compact framework), so I have a indefinited number of "Inherits System.Windows.Forms.Control" and
only one "Inherits System.Windows.Forms.Form" alias the MainForm.
In this MainForm I have created the menu and I have added the menuItems visible for all the "Controls".
I want personalize the menuItems and render visibles some Items in some controls and not in other.
which is the best way to improve my code?
I've tryed to disabled my menuItems with the fragment "me.menuItem.disabled = true" in maiform, and it give back correcty disabled the component in every forms, but i I want render it disabled in an other form what I should do?
thank to everybody!
daniele castrovinci
|
|
|
|
|
What is form handle in .net and at what time we will create and use them?
|
|
|
|