|
Its possible but not easy. The class DataGridTextBoxColumn is by default (unless its a boolean column) the class which determines how a cell is painted. In its implementation it uses the font of the DataGrid. If you want to have several different fonts in your grid you will need to create your own implementation of DataGridColumnStyle or at least inherit from DataGridTextBoxColumn and change it to your needs. You would then have to change (at least) the implementations of Paint, MinimumRowHeight, GetPreferredHeight and GetPreferredSize. You probably should use Reflector (which you can get here) to get some feeling how those methods should be implemented.
|
|
|
|
|
I have a simple little browser im working on as a past time. I have most of the basic buttons down (back,forward,stop,refresh,go,etc...)
What I am trying to do is make a status bar at the bottom of the browser and here is where i have hit my road block. Does anyone know of/where i could find a sample code for it? I am completely stumped at this point
Thanks
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
Code is a beautiful thing
Theres nothing like the feeling you get when you create your first program.No matter how basic
MS DOS it all
|
|
|
|
|
Why not use that little search field here on CodeProject?
When searching for status bar you will get several hits. Most of them deal with inserting a progress bar into the status bar, but most of them also show/have example code how to use it in general.
|
|
|
|
|
sry i was feeling a bit lazy yesterday.....
im gunna be sure to search later when I have the time, thanks for the response
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
Code is a beautiful thing
Theres nothing like the feeling you get when you create your first program.No matter how basic
MS DOS it all
|
|
|
|
|
Hi,
Have anybody tried inheriting from CommonDialog class
I want to know, how to implement the RunDialog() function
in my derived class?
Thanks
|
|
|
|
|
I have downloaded a binary stream of data from a GPIB (IEEE 488.2) instrument that contains an EEPROM on the sensor connected to it. I have the header and table structure of the information and some of the types that the data represents, i.e. "7.8 (signed)", "16 bit integer" <-- quoted from the instrument programming manual.
I am trying to convert this data into usable numbers, for example:
The header is made up of 9 bytes. The first two bytes make up a "7.8 (signed)" value ranging from -127.0 to +127.9, the second two bytes are the same, the third and fourth bytes make up a 16 bit integer.... and so on.
After the header is a table containing various other data types and contents. I have the full byte table from the manufactures manual if anyone that would like to help needs it.
Any help would be appreciated, this has been one big headache, and I'm sure our customer will be glad to know we got it to work.
|
|
|
|
|
Hi,
for all types which have equivalents in .Net (like 16 bit integer to Single) you can use the BitConverter class. It provides static functions to convert byte arrays to the specified format and vice versa.
With the other type I cant help you. I dont even know what "7.8 (signed)" exactly mens. I think its some kind of floating point type but .Net only provides 32 and 64 bit floating number types. If you programming manual has some more info regarding this type then feel free to post it here.
|
|
|
|
|
Robert,
Thanks for the quick response.
I spoke to the Manufacturer and obtained detailed information concerning the conversion of the Bytes to usable values. Multiplying Int32 by some number, dividing by another, blah blah blah.
Anyway, thanks for all the help,
Scott
|
|
|
|
|
what is the code to connect to ISP(sbcyahoo)with DSL in vb.net?
All help appreciated!
|
|
|
|
|
I'm writing my first VB app. Please no cheering. In VC++ if I had a sting that I wanted to have hex values in it as well as regular letter I could do something like this
CString myData;
myData.Format("these are my hex values \x06 \x4c");
How can I do this is VB? Is there a format function in VB?
Thanks
Tom Wright
tawright915@yahoo.com
|
|
|
|
|
In Visual Basic you will have to do the following.
Let say you have an integer
Dim myInt As Integer = 715
Dim myStr As String
myStr = "0x" & Format(myInt, "x4")
myStr will have the value 0x02cb. If you replace x4 above with X4 then myStr will have the value 0x02CB. The 4 in X4 is a field width, it will pad zeros to fill the field.
Another way to do the same thing
myStr = "0x" & HexVal.ToString("X4")
|
|
|
|
|
Can anyone convert this from C# to VB.net:
object [] arrReturn = null;
string SP_NAME = "GetIDProc";
string RetID;
SqlParameter[] parameters = { SqlAccessor.SqlParameterBuilder("@RetOrderID", SqlDbType.VarChar, 10, ParameterDirection.Output),
};
int iRow = SqlAccessor.ExecuteNonQuery(connectionString,
SqlAccessor.SqlCommandBuilder(new SqlCommand(SP_NAME), parameters),
CommandType.StoredProcedure, out arrReturn);
RetID = (string) (arrReturn[0].Equals(System.DBNull.Value) ? 0 : arrReturn[0]);
if (iRow > 0)
{
string myFormat;
DateTime d = new DateTime();
OrderNum.Text = d.Year.ToString() + "/" + RetID;
}
else
{
OrderNum.Text = "Cannot Get Details";
}
|
|
|
|
|
is this for any homework ?
don't you really understand anything in the code you provide ??
well, as i am in a good day, here is you code, but try to use your brains a bit more next time :
Dim arrReturn() As Object
Dim SP_NAME As String = "GetIDProc"
Dim RetID As String
Dim Parameters As SqlParameters
Parameters = New SqlParameters { _
SqlAccessor.SqlParameterBuilder("@RetOrderID", _
SqlDbType.VarChar, _
10, _
ParameterDirection.Output) _
}
Dim iRow As Integer = SqlAccessor.ExecuteNonQuery(connectionString, _
SqlAccessor.SqlCommandBuilder(New SqlCommand(SP_NAME), _
parameters), _
CommandType.StoredProcedure, _
arrReturn)
RetID = IIf(arrReturn(0).Equals(System.DbNull.Value), 0, arrReturn(0)).ToString()
If iRow > 0 Then
Dim myFormat As String
Dim d As DateTime = New DateTime()
orderNum.Text = d.Year.ToString() & "/" & RetID
Else
orderNum.text = "Cannot Get Details"
End If
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I am getting errors with the following 2 lines:
Dim iRow As Integer = SqlAccessor.ExecuteNonQuery(connectionString, _ SqlAccessor.SqlCommandBuilder(New SqlCommand(SP_NAME), _ parameters), _ CommandType.StoredProcedure, _ arrReturn)RetID = IIf(arrReturn(0).Equals(System.DbNull.Value), 0, arrReturn(0)).ToString()
The errors are:
'SqlParameterBuilder' is not a member of 'System.Data.SqlClient.SqlCommand'.
'Public Overridable NotOverridable Function ExecuteNonQuery() As Integer' has no parameters and its return type cannot be indexed.
'SqlCommandBuilder' is not a member of 'System.Data.SqlClient.SqlCommand'.
|
|
|
|
|
|
The converter you mentioned does not come close at all to converting the C# code posted:
1. Left in the ternary ('?') operator.
2. Left in the 'out' keyword.
3. Left in '+' for string concatenation, which is very poor style (and will generate errors when both operand are not strings).
David Anton
Tangible Software Solutions
www.tangiblesoftwaresolutions.com
Home of the Instant C# VB.NET to C# Converter and the Instant VB C# to VB.NET Converter
|
|
|
|
|
No, it's not perfect but sometimes saves you effort. Also, it seems to work best when you try small sections at a time. However, I've only used it once or twice, when I was working in a contract where they used VB .NET.
Kevin
|
|
|
|
|
Our Instant VB C# to VB.NET converter (www.instantvb.com) produces the following:
Private Sub test()
Dim arrReturn As Object() = Nothing
Dim SP_NAME As String = "GetIDProc"
Dim RetID As String
Dim parameters As SqlParameter() = { SqlAccessor.SqlParameterBuilder("@RetOrderID", SqlDbType.VarChar, 10, ParameterDirection.Output)}
Dim iRow As Integer = SqlAccessor.ExecuteNonQuery(connectionString, SqlAccessor.SqlCommandBuilder(New SqlCommand(SP_NAME), parameters), CommandType.StoredProcedure, arrReturn)
RetID = CStr(IIf(arrReturn(0).Equals(System.DBNull.Value), 0, arrReturn(0)))
If iRow > 0 Then
Dim myFormat As String
Dim d As DateTime = New DateTime()
OrderNum.Text = d.Year.ToString() & "/" & RetID
Else
OrderNum.Text = "Cannot Get Details"
End If
End Sub
David Anton
Tangible Software Solutions
www.tangiblesoftwaresolutions.com
Home of the Instant C# VB.NET to C# Converter and the Instant VB C# to VB.NET Converter
|
|
|
|
|
David,
Thanks for the reply. Somone gave me this code but they didn't tell me what they declared SqlAccessor as. Would you have any ideas what SqlAcessor should be declared as from looking at the code??
Thanks.
|
|
|
|
|
Sorry - there's a number of different classes with a "ExecuteNonQuery" method. And there are no classes that sound close enough to SqlAccessor, so I couldn't say what it's declared as.
David Anton
Tangible Software Solutions
www.tangiblesoftwaresolutions.com
Home of the Instant C# VB.NET to C# Converter and the Instant VB C# to VB.NET Converter
|
|
|
|
|
HI to all
Please tell me how to create the setup file for the project which have database (SQL SERVER 2000) in it?
Please exaplain me the whole procedure of creating the setup file so that i can install this project on any other machine.
Thanx for help in advance.
BYE from ARFAN QADIR
|
|
|
|
|
Deploying apps is pretty simple and you should be able to get detailed information from any VB.net book. However, to get you started, right click on your solution, select Add->New Project then click on Setup and Deployment Projects and select Setup Wizard. In the options select Setup for windows app and <primary output<="" b=""> from your project.
The setup automatically detects all dependencies needed for your app.
Now, if your project has a database then you should be able to include any additional files in your setup project.
|
|
|
|
|
Hi.
I have a VB.NET program that is creating Word documents based on an existing template file by filling in data retrieved from a database. Some of the content in the Word document is maintained in custom properties, however, although it is very easy to manage these from with a Word macro, I am having difficulty getting hold of the CustomDocumentProperties collection from within VB.NET. Originally, I tried having a variable of type Word.CustomProperty which I would use, in conjunction with the CustomDocumentProperties collection, but had absolutely no joy. Am I being stupid and missing something very obvious.
The problem seems to be that for some reason, CustomDocumentProperties is of type System.__COMObject and does not have any discernable methods or properties. For now, I have created a single line word macro (as part of the original template) that simply sets a custom property to the value you desire, but this is far from ideal, and really goes against the grain for me!! Unfortunately, this is not a solution that can be entirely coded in Word as it is essentially a very small part of a bigger solution (the word doc is just something that is produced at the same time as other things)
Does anyone have any experience with CustomDocumentProperties from VB.NET when talking to Office 2003. I prefer to use Option Strict On, but if it is necessary to turn it off, I will!
A code snippet from .NET that I am using (simplyfied) is shown below. Any help with this would be greatly appreciated
Imports Word = Microsoft.Office.Interop.Word
..
..
..
Dim oWord As Word.ApplicationClass
Dim docCurrent As Word.Document
'
' Start MS Word and open the document.
'
oWord = CType(CreateObject("Word.Application"), Word.ApplicationClass)
docCurrent = oWord.Documents.Open(FileName:="C:\MyOriginalDoc.doc", ReadOnly:=True)
'
' Since it seems impossible to get to the CustomDocumentProperties collection with the Word
' object Model through VB.NET, we run a little macro that is embedded in the template to
' populate the custom properties. Not nice, but apparently necessary - although I won't be
' defeated, so whatch this space!
'
oWord.Run("SetDocProperty", "PhaseDescription", strPhaseDesc)
'
' And now we update the fields
'
docCurrent.Fields.Update()
oWord.Options.PrintFieldCodes = False
docCurrent.PrintOut()
docCurrent.SaveAs("c:\MyNewDocument.doc")
'Quit Word.
oWord.Quit()
Marshal.ReleaseComObject(oWord)
oWord = Nothing
|
|
|
|
|
I have a command in my project like:
wordDoc.Content.Find.Execute(FindText:="#TEST#", ReplaceWith:="ABC" & chr(13) & "DEF", Replace:=Word.WdReplace.wdReplaceAll)
This code will replace #TEST# with this one
ABC
DEF
but , once i have this Word document... the content became ABCDEF , where there is no more "carriage return" in between..
anyone can help me??
|
|
|
|
|
="ABC" & chr(13) & chr(10) & "DEF"
|
|
|
|