|
hi every one
I have made an custom DataGridView column which inherits from DataGridViewTextBoxCell ,In have written a custom textBox too which has some properties I had this code so the type is changed to my custom TextBox:
Public Overrides Sub InitializeEditingControl(ByVal rowIndex As Integer, _
ByVal initialFormattedValue As Object, _
ByVal dataGridViewCellStyle As DataGridViewCellStyle)
' Set the value of the editing control to the current cell value.
MyBase.InitializeEditingControl(rowIndex, initialFormattedValue, _
dataGridViewCellStyle)
Dim ctl As CurrencyTextBoxEditingControl = CType(DataGridView.EditingControl, CurrencyTextBoxEditingControl)
ctl.Text = Me.Value.ToString
End Sub
now I want to be able to change some of this custom TextBox via Column properties via designer. I mean that I want to see the cell's Custom TextBox's properties in the Column properties in design time.
how can I do it?
thanks in advanced
|
|
|
|
|
I developed vb.net application it is windows based, my need is in that application worked in LAN, I run the exe file in client desktop computer it is coming error:
A connection was successfully established with the server, but then an error occurred during the per-login handshake. When connecting to SQL server 2005, this failure may be caused by the fact that under the default setting SQL Server does not allow remote connections. (Provider: Named Pipes Provider, error: 0 - No process is the other end of the pipe.)
Franics K Antony
|
|
|
|
|
|
i have two windows form, in one form i have a textbox, in another form,i have a gridview, all i want is how to transfer the data from textbox to gridview after i click the button?
|
|
|
|
|
ganesh kumarrr wrote: all i want is how to transfer the data from textbox to gridview after i click the button?
In the event handler for the button. Take the text from the text box and put it in the gridview.
Or do I misunderstand your question?
|
|
|
|
|
s u are correct, but how to code it?
|
|
|
|
|
ganesh kumarrr wrote: how to code it?
Read the documentation on TextBox and GridView classes. In there you will discover all the properties and methods that will allow you to accomplish this task, plus you will learn all sorts of good things that will help you in the future.
|
|
|
|
|
You're translator is broken
Richard MacCutchan wrote: ganesh kumarrr wrote:
how to code it?
This = snd codz plz
I did like you response though.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
add a string variable int the form that has the grid view.
overload the constructor that take a string argument. You have to initialize the string variable by the given parameter.Then call the constructor from the form that has the texbox as follows:
gridviewform f = new gridviewform(texbox1.text);
f.Show();
write this code in the formload event of form that has the grid view.
int p = dataGridView1.Rows.Add();
dataGridView1.Rows[p].Cells[0].Value = your string variable
|
|
|
|
|
Hi,
When I use the code below to open the form 'MainForm', the text position on buttons and labels differs slightly from the position in the designer. For some labels the text is displayed on two lines, while the text fits exactly on one line in the form designer. If I do not define a Sub Main, but set the MainForm as Startup form, the form shows correctly. Has anyone an idea what could be the cause of this strange behaviour?
Shared Sub main()
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(MainForm)
End Sub
Thanks,
Marc
|
|
|
|
|
Its the EnableVisualStyles line that may be causing it. This tell the app to use the systems theme styles render instead of the standard one. This changes stuff like font rendering.
What version of Visual Studio are you using?
|
|
|
|
|
I'm using Visual Studio 2008 Professional Edition.
Is there a way how I can make sure that the style renderer that is used on runtime is the same as the one used in the form designer?
|
|
|
|
|
When Dave said EnableVisualStyles is what triggers the theme-based renderer, doesn't that suggest you to try and run your code without that statement, and see what gives?
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? 59.24% waren verstandig genoeg om NEEN te stemmen; bye bye viaduct.
|
|
|
|
|
Ok, sorry, should have mentioned that I tried that already. But when I remove the EnableVisualStyles statement, the whole XP-style disappears (of course ). It seems to me that the EnableVisualStyles statement is correct, as I want to use the systems theme.
The form is during run-time and in the form designer almost identical (i.e. using XP style), the only little difference is that the text on labels and buttons is moved about 1 or 2 pixels, which results in some cases in two lines of text in stead of one, as the text doesn't fit on one line anymore. Of course I could make the labels and buttons a few pixels larger. It's just that I don't like the fact that there is a differce between the form in the designer and in run-time. Someting must cause the difference...
Furthermore, when I start the form by setting the MainForm as Startup form in the project properties, and enabling XP visual styles, the form shows correctly.
So any help / suggenstions are welcome!
|
|
|
|
|
OK, I don't know the solution; I tend to make my controls slightly wider to avoid such issues.
BTW: what will happen if you ever need to internationalize your Form?
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? 59.24% waren verstandig genoeg om NEEN te stemmen; bye bye viaduct.
|
|
|
|
|
Ok, thanks anyway!
Someone else any suggestions???
|
|
|
|
|
There is a relatively well known problem in this context, caused by the differences in the way that GDI and GDI+ do their rendering which may explain your problem.
This[^] explains it and has a demo project.
There is a better explanation that I cannot locate at the moment. Some time ago I posted it on CP for another member. At that time I found it by Googling gdi v gdi+, which is where I got the link above. If you have more patience than I, give it a try.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Ok, I finally found the solution. If I set the buttons and labels 'FlatStyle' property to 'Sytem' in stead of 'Standard', the form shows up correctly in run-time.
However, I'm still wondering why there is a difference between setting EnableVisualStyles in code (showing the text different then in the designer) and setting 'Enable XP Visual styles' in the project properties (showing the text the same as in the designer)...
|
|
|
|
|
hi friends,
i am facing a problem like we i ping a node i got following response
CAREFULLY see PING STATS
Pinging 10.10.34.45 with 32 bytes of data:
Destination Host Unreachable
Destination Host Unreachable
Destination Host Unreachable
Destination Host Unreachable
Ping statistics for 10.10.34.45:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
if node is not reachable how i am getting received packet.... and 0% loss
plz help me solve this..
Thanx for your valuable help
optimus
|
|
|
|
|
The received packet that it's talking about is the one coming back from the router explaining that there is no route to the destination network. No, it's not the original ping packet, but a valid pakcet did come back, so, yes, it's a "successful" receipt. If not packet had come back at all, that's the "Lost" packet.
|
|
|
|
|
thanx for reply ..
but how can i solve this
actually i hav written a script to ping 3000 node and depending on their error level it will find out which is unmanaged
but due to above problem my script logic is not working ..
i want that if node is not reachable no packet should be receive ...
plz suggest...
thanx
|
|
|
|
|
Standard Question #2: What does the code look like that is doing the pings?
|
|
|
|
|
Hi,
if the PING utility, with all its options, does not satisfy your needs, you may have to create your own; you then could have a look at the System.Net.NetworkInformation.Ping class
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
Local announcement (Antwerp region): Lange Wapper? 59.24% waren verstandig genoeg om NEEN te stemmen; bye bye viaduct.
|
|
|
|
|
hi sir
i am using following code for encrypt my textbox value and save it in encrypted form to our database.
Public function encrp(ByVal enc As String) As String
Dim ctr As Byte() = System.Text.ASCIIEncoding.ASCII.GetBytes(enc)
Dim c As String = System.Convert.ToBase64String(ctr)
Return c
End function
and following code for decrypt the value for showing in textbox
Public function decryp(ByVal c As String) As String
Dim b1 As Byte() = System.Convert.FromBase64String(c)
Dim f As String = System.Text.ASCIIEncoding.ASCII.GetString(b1)
Return f
End function
but sir i am unable to decrypt my dataset with the help of this function to show the record in datagridview.so please help me for decrypt the dataset.
sir reply please.
|
|
|
|
|
Don't post the same question again in the same day. You just posted this less than 4 hours ago.
|
|
|
|