|
|
Hi Guys..
i'm using the following code (in vb 6 ) to encode an ARABIC String into the UCS2 ,assighned to the StrData Byte Variable then pass the StrData To The Function to do then encoding..
the problem is when i wanted to apply this code in vb.net there were a problem in assighning a string value into the StrData Byte Variable,which tells that can't convert string variable into 1-dimention array of byte.!!
and when i changed the function to accept an array of characters insted of a byte var. it always return the same encoding for any arabic string..!!
do any 1 know how to solve this problem? or know any good simple way to encode arabic string to UCS2 ..?
here is the function in vb6...
Public Function ArabicHex(b() As Byte) As String<br />
Dim s As String, h As String<br />
Dim i As Integer<br />
i = 0<br />
s = ""<br />
While i <= UBound(b)<br />
h = Right("00" & Hex(b(i)), 2)<br />
i = i + 1<br />
h = Right("00" & Hex(b(i)), 2) & h<br />
If h = "000D" Then h = ""<br />
s = s & h<br />
i = i + 1<br />
Wend<br />
ArabicHex = s<br />
End Function
any quick response will be helpfull and thankfull..
confused:
|
|
|
|
|
Hi There!!
When I run the program that I have created for a Pocket PC device it does not show my application on the Project PC Emulator, is it possible to view your created program on there without having to upload it to a real Pocket PC!!, If so please can you give me advice on how to do this.
Thanks
|
|
|
|
|
You need to deploy your app to a Emulator you selected
ASP.NET C# VB VC & SQL Windows APP ...
|
|
|
|
|
Hello there
I have built a mulit-lingual application. The default language is English. When User Change the language I fetch the record from resource file and re-set the labels with the new language. but when I assign the new language, The font which was Bold becomes normal. and from now onwards if you go back to English language it will remain normal.
Any Idea's.... ?
|
|
|
|
|
I am trying to get a listbox to allow drag and drop between another listbox and also act as a navigator for some textboxes bound to columns on a DataTable. I am able to get both to work but not at the same time. Both features require the use of the the MouseDown event handler. However a MouseDown event is just that. Logically you want the MouseDown handler fired by the ListBox Navigation to always run first.
For the drag and drop, I bound the navigation ListBox and the other listbox to their own DataTables that have the same schema. Then I just add and remove DataRows between the 2 datatables for the drag and drop.
For the navigation ListBox, I make sure that the textboxes are bound to the same DataTable the nav-Listbox is bound to. VB.Net and I think the currency manager does the rest. When you click on the nav-ListBox item it brings up the record that the listbox item is tied to and all the textboxes are refreshed.
Here is how I got the ListBox Navigator to work
dtUsedSoftware = getDataTable()<br />
With lstUsedSoftware<br />
.DataSource = dtUsedSoftware<br />
.ValueMember = "SoftwareID"<br />
.DisplayMember = "SoftwareName"<br />
.SetSelected(0, False)<br />
<br />
End With<br />
<br />
txtInstanceName.DataBindings.Clear()<br />
txtInstanceName.DataBindings.Add(New Binding("text", dtUsedSoftware, "InstanceName"))<br />
txtInstalledVersion.DataBindings.Clear()<br />
txtInstalledVersion.DataBindings.Add(New Binding("text", dtUsedSoftware, "InstalledVersion"))
Public Sub lstUsedSoftware_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles lstUsedSoftware.MouseDown<br />
<br />
If ((e.Button And MouseButtons.Left).Equals(MouseButtons.Left)) Then<br />
'' check to see if lstbox has any items<br />
Dim dtRow As DataRow<br />
dtRow = dtUsedSoftware.Rows.Find(lstUsedSoftware.SelectedValue)<br />
<br />
'commenting the line below makes the listbox navigation work<br />
<br />
lstUsedSoftware.DoDragDrop(dtRow, DragDropEffects.Move)<br />
<br />
'what I really want is for the listbox navigation MouseDown event to fire on MouseUp instead. <br />
End If<br />
End Sub
|
|
|
|
|
Basically you have to force the item selection before calling DoDragDrop. Since the MouseEventArgs gives you the coordinates of the mouse click then you can find out which item got clicked and force the selection as follows:
Dim selectedIndex As Integer = Me.ListBox1.IndexFromPoint(New Point(e.X, e.Y))<br />
lstUsedSoftware.SetSelected(selectedIndex,True)<br />
:<br />
:<br />
lstUsedSoftware.DoDragDrop...<br />
|
|
|
|
|
It worked......and I was going to catch the event with iMessageFilter. That would have been a mess. thanx
Does anyone think that using complex data binding to synchronize a listbox to some textboxes is bad? I've read some articles saying that complex databinding is bad programming practice.
|
|
|
|
|
|
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";
}
|
|
|
|