|
I already told you, you have to write your own serializer since Control's are not serializable themselves. You'd probably user Reflection to pick out the Properties you want and ignore others. This is NOT an easy thing to do and is NOT for someone who's a beginner to tackle. This requires knowledge of Reflection and XML document generation.
The PropertyGrid will NOT do this for you.
|
|
|
|
|
Thanks For Replying ,
Hi , now i am using my own custom propertygrid for runtime controls when i am clicking on textbox it is showing properties . I am showing font,backcolor,location ,like some properties
1) How to create the wordwrap,TextAlign properties .
2) Now the problem arises with borderstyle ,Multiline and some other Properties while selecting textbox, I am not able to set these properties .These are not there by default for runtime ctr.I created the properties for borderstyle,. I dont know how to create the property for TextAlign . NOt Coming with (System.Win.Forms.TextboxBase)
3) In PropertyGrid1_PropertyValueChanged , i am writing like this
Case "Font"<br />
ctr.Font = e.ChangedItem.Value<br />
Select Case e.ChangedItem.Label<br />
<br />
Case "BackColor"<br />
ctr.BackColor = e.ChangedItem.Value<br />
<br />
Case "BorderStyle"<br />
if ctype(sender,TextBox) then '''Borderstyle not coming <br />
ctr.BorderStyle( Not Coming) = e.ChangedItem.Value <br />
<br />
Dim ctr As New TextBox ''If i use like this only borderstyle is coming "<br />
ctr.BorderStyle( Coming) = e.ChangedItem.Value ' but Not working <br />
waiting For Reply ......
DVSriram
|
|
|
|
|
i have created a windows service project and a deployment project to deploy the service.
i use the setup.exe created to install the service. The service installs fine and appears in services in control panel. but when i right click and start the service i get an error message 'could not start the service1 service on the local computer.
the service did not return an error. this could be an internal windows error or an internal service error.'
so then i tried running the service from program files and i get another error message saying 'cannot start the service from a command line or debugger. a windows services must first be installed (using installutil.exe) and then started with the server explorer or windows servce administrative tool.
is there anything i need to change to get this to work.
|
|
|
|
|
What does the code look like in your OnStart event??
You SHOULD be starting a new thread that does the work of the service. If all of your code is in the OnStart event, your code hasn't finished before the Service Manager times out and considers your service as failed.
|
|
|
|
|
i first wrote the code for the service in a simple windows app to test it and it worked fine and then copied it over to the service. in the app the code was run when a button was clicked. in the service the the code is run in OnStart.
|
|
|
|
|
There's you're problem. You cannot do that. OnStart is expected to return control back to the Service Manager within 30 seconds. Your code won't do that.
You MUST start a new thread that your service code runs under so the OnStart method can return control back to the Service Manager. This is going to require you to rewrite your code for a threaded environment.
|
|
|
|
|
I have a problem on the below random codes. The codes are actually working. But sometime it just hang after clicked on the randomise button. (I suspect it kept looping at (while loop) to search for random number. Can it be??)Can anyone help me? Here are my codes.
Private oQuestionCount As Integer = 5
Private sQuestionCount As Integer = 2
Dim tQuestion As Integer = ds.Tables("FilteredQuestion").Rows.Count
Dim aSize As Integer
If Me.cbQuesType.Text = "Obj" Then
aSize = oQuestionCount
Else
aSize = sQuestionCount
End If
If tQuestion = 0 And tQuestion < aSize Then
MessageBox.Show("The questions from the Question Bank is not enough")
Me.Dispose()
End If
Dim rnd = New Random
Dim irnd As Integer
Dim arnd(aSize - 1) As Integer
Dim aID(aSize - 1) As Integer
Dim i As Integer
Dim sID As String
Dim iStudentCount As Integer
Randomize()
For i = 0 To aSize - 1
irnd = rnd.Next(0, tQuestion - 1)
Do While Array.IndexOf(arnd, irnd) > -1
irnd = rnd.next(0, aSize - 1)
Loop
arnd(i) = irnd
aID(i) = ds.Tables("FilteredQuestion").Rows(irnd)(0)
If i = aSize - 1 Then
sID = sID & aID(i)
Else
sID = sID & aID(i) & ","
End If
Next
Thanks ....
|
|
|
|
|
Your name is not an intelligent subject, please try to choose one that makes sense. It helps people know if they can help you.
This looks like a mess. What are you trying to do ? Have you tried breaking into your code when it hangs to see what is going wrong ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi Christian Graus,
Thanks for the comment on the subject. I had changed it.
Yes, i tried to break the code and found out that it kept looping in the (while loop) to search for numbers i guess.
Actually what i'm trying to do is to retrieve random question from a table. This is a exam. paper program. So the student will login their ID to sit for exam. This program is to retrieve random question so that every student will not get the same quetion. This is my first time writing code for randomise. No idea what went wrong. Can you advice me? thanks in advance.
|
|
|
|
|
Hi.
I opened a VB .NET project with Visual Studio 2005. I have had limited contact with VB in the past and I'm not very comfortable using it.
My question:
Doesn't VS 2005 have a refractor for VB .NET??
I wanted to rename a method with (CTRL+R,R) just like I do in C# and VS says "The key combination (CTRL+R,R) is bound to a command(&Rename) which is not currently available".
And the menu Refractor, which in C# is between "View" and "Project" doesn't exist as well...
|
|
|
|
|
The keyboard shortcuts are probably different, but refactor should be on the right click menu ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
As opposed to C#, where there's the Refractor group with "Rename", "Extract method", etc, in VB there's only a single option called Rename, which brings up a "Rename" dialog. But it is simpler than the standard one of Refractor, more precisely it doesn't have any options (preview, search in comments & search in strings)
|
|
|
|
|
hai to all
i am working only vb .net,i val;i validate the text box only numbers & Only characters,so not support the platform keypress event and click event,pls give me a solution
Rathi
|
|
|
|
|
Ursrathi wrote: so not support the platform keypress event and click event,pls give me a solution
I don't understand ? The Textbox DOES support the keypress event.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I have checked the events of TextBox. It does support KeyPress event. Can you recheck at your end.
You can use the following code for validation on a TextBox.
<br />
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress<br />
<br />
Select Case (Asc(e.KeyChar))<br />
<br />
Case 8, 48 To 57, 65 To 91, 96 To 122<br />
<br />
e.Handled = False<br />
<br />
Case Else<br />
<br />
e.Handled = True<br />
<br />
End Select<br />
<br />
End Sub<br />
Allen Smith
Software Engineer
ComponentOne LLC
www.componentone.com
|
|
|
|
|
Gosh, that's nasty. I use stuff like Char.IsControl, Char.IsDigit and Char.IsAlpha to write this sort of code.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Why dont u use mask edit box to solve ur issue???
|
|
|
|
|
how to make search button in the vb 2005?
jack
|
|
|
|
|
Easy - put a button on the form and write code to search. For more help, give more details.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i'm looking for how to use for...next loop for my project
i want to use that coding for the how many months left when the user pay the payment on my system
jack
|
|
|
|
|
A for next loop is a very basic C# construct. Buy a book and work through it if you don't know this stuff.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Dim i As Integer = 0
Dim dt_result As New DataTable
For i = 0 To dt_result.Rows.Count - 1 Step 1
'Here ur coding
Next
Janani
|
|
|
|
|
Add a row: (consider that your listview has 2 columns)
Dim item as new listviewitem("new row")
item.subitems.add("new row's column 2")
Listview1.items.Add(item)
Edit the row, you enumerate through the list or get the selected row
Dim item as ListViewItem = ListView1.SelectedItem(0)
item.Text = "new row modified"
item.subitems(1).Text = "new row's column 2 modified"
That should be it...
|
|
|
|
|
Hi
I have a program which collects performance counters from any system on a network - the problem is, it works fine if the native OS is English, but refuses to collect any counter in any other language OS (German, for example). Anybody else faced this issue? Any suggestions?
Thanks for your help
Chandra Ram
|
|
|
|
|
The counter names would be localised so you need to adjust the name of the counter you are opening according to the locale setting.
|
|
|
|