|
|
Thank you very much..
I'll check it'
|
|
|
|
|
Hi guys
I m looking for some (free) code converter which can change C# code to VB.NET, any help will be highly appreciated
Thanks in Advance
Utsav
|
|
|
|
|
There are a couple dozen of them. Google for "C# VB.NET conversion" and you'll find what ye seeks.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Our C# to VB.NET converter, Instant VB, is not free, but you may find the free Demo Edition (converts up to 100 lines at a time) useful (www.instantvb.com).
David Anton
Tangible Software Solutions
www.tangiblesoftwaresolutions.com
Home of:
Instant C#: VB.NET to C# Converter
Instant VB: C# to VB.NET Converter
Instant J#: VB.NET to J# Converter
|
|
|
|
|
For example, I have Form1 and Form2, Form1 is parent of Form2.
When Form2 is active, how can I tranfer some values to Form1 components?
Many thanks.
|
|
|
|
|
Give Form1 a setter method to accept the values...
internal void SetValues(...){ ... }
...and add an owner-parameter to Form2's constructor.
public Form2(Form1 owner){<br />
this.owner = owner;<br />
}
Then Form2 can send the values to Form1:
owner.SetValues(allMyValues);
_________________________________
Please inform me about my English mistakes, I still try to learn your language!
|
|
|
|
|
If I understand your question correctly (some code really helps with saying what you want), you have a line somewhere in Form1 saying myForm2.ShowDialog() , right?
And now, while myForm2 is showing, you want to set some values for the dialog.
If this is what you want, then the answer is: It cannot be done (well, it _can_ be done but it would be far too complicated an is really not encouraged).
The reason is that calling ShowDialog doesn't return control to the calling function until the second form is closed, so you can't execute any other code.
You should use myForm2.Show() instead of myForm2.ShowDialog() in this case. Show() returns immediately, making myForm2 a nonmodal dialog. Your Form1 isn't blocked anymore and can access myForm2 immediately afterwards.
Regards,
mav
|
|
|
|
|
Thanks for your reply, but is there any way to use ShowDialog? ^^
|
|
|
|
|
Well, since the thread executing the ShowDialog call is effectively blocked until ShowDialog returns, you'd have to create a new thread, give it a reference to the Form you're displaying with ShowDialog() and then let the new Thread operate on myForm2.
But you'll probably run into some problems developing this, inter-thread-calls having to be done via Invoke being the least of them.
Using Show() is the much better alternative IMHO. Easier to implement and to understand.
mav
|
|
|
|
|
After receive some instructions, now I can do what I want.
--------------------
class Form2 : Form
{
public Form1 form1;
...
--------------------
class Form1 : Form
{
...
void Form1_Load(object sender, EventArgs e)
{
Form2 form2 = new Form2();
form2.form1 = this;
form2.Show(); //form2.ShowDialog is still OK
}
...
}
And then we can use "form1" with every methods, properties or controls in Form1 that Form2 have permission to access.
Reference:
http://searchvb.techtarget.com/vsnetATEAnswers/0,293820,sid8_gci875271_tax293474,00.html[^]
|
|
|
|
|
hi,
I would like to find some examples for making draggable toolbar, and so that it can dock to some where.
anyone can give me some hints? thanks
|
|
|
|
|
HI!
There are quite a few articles here on the topic, you might want to use the search function.
One of them is here[^]
Regards,
mav
|
|
|
|
|
Can you help me?
hope for help
|
|
|
|
|
WindowState = Maximized and no bitle bar
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Just set your Form 's FormBorderStyle to None and resize your form to match the size of the screen. The screen size can be retrieved using the System.Windows.Forms.Screen class.
Regards,
mav
|
|
|
|
|
I have two windows forms. In the first form I am trying to call a method from the second form. I have created an instance for the second form but it will not let me access the method unless i change it to static but if I change it to static the other calls to controls in that form don't work.
Form 1:
Form frm2 = new Form2();
...
...
frm2.SetupScreen();
Form 2:
public void SetupScreen()
{
this.richtextBox1.Text = "";
......
}
Can someone please help me with this?
|
|
|
|
|
|
I found the problem.
I used:
Form frm2 = new Form2();
I should of used:
Form2 frm2 = new Form2();
|
|
|
|
|
DateTimePicker ...How to take it null when binding it to a datetime field?
I have an Customers table (ID,Name,BirthDay(datetime))
and I use DatetimePicker to bind with BirthDay...
and when I don't know the birthday of some Customers ,so I want its value is null....Can you help me????thank you so much...
The man with nothing to lose
|
|
|
|
|
The default Windows.Forms.DateTimePicker cannot be empty.
Search the articles for "nullable datetime", all you'll find better DateTimePickers, like this one[^] or that one[^]
_________________________________
Please inform me about my English mistakes, I still try to learn your language!
|
|
|
|
|
Hi Khanh,
istead of DateTimePicker.Value = null use DateTimePicker.Value = System.DBNull.Value
Hope that helps
GanDad
|
|
|
|
|
How to create expression column named Age from the existing column BirhtDate?
Sorry for bad English.
Thank You.
|
|
|
|
|
int Age = DateTime.Now.Year - birthDate.Year;
What do you mean by 'expression column' ? You want to show this in a datagrid ? Then you need a column that binds to a function that calls the above code.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi, Sir.
I mean...
DataColumn c = new DataColumn();
c.Expression = "BirhtDate - DateTime.Now";
Is it possible to create a column like I mean above?
Thank You.
|
|
|
|