|
|
hi
i want to connect a property grid to a button and only show BackColor in this property grid but not with caption "BackColor" and instead of this i want to show for example "ColorButton"
when user changed this property like changing backcolor , color of button must be change.
i can declare my own property but i can't connect that to my button???
how can i do this ????
Best Regards
-------------
MkhProgrammer
|
|
|
|
|
hi all,
i want to pass the text of a textbox in one webform to the text property of a label in another webfor, in the same web application. can anyone tell me. ow it can be done.
thanks in advance.
|
|
|
|
|
The easiest way is to store the required value in Session State.
WebForm1
Session("MyValue") = FromTextBox.Text
WebForm2
If Not Session("MyValue") Is Nothing Then<br />
ToLabel.Text = Session("MyValue")<br />
End If
You could also get the ViewState information from the original WebForm by using the Server.Transfer method. This method requires that the EnableViewStateMac attribute of the WebForm be set to False so that the ViewState is not hashed.
WebForm1
Server.Transfer("WebForm2.aspx", True)
WebForm2
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
Dim fromForm As System.Collections.Specialized.NameValueCollection<br />
fromForm = Request.Form<br />
ToLabel.Text = fromForm.Item("FromTextBox")<br />
End Sub
|
|
|
|
|
I'm trying to change the font of a selected row (not all) in DataGrid. But it's still not yet. Please give your advise with this problem if possible. Thanks a lot.
Phuc Hua
|
|
|
|
|
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
|
|
|
|